Part Number Hot Search : 
NTE316 2SK22 045CT NCP1561 KQT040 S1501 61000 CM1208
Product Description
Full Text Search
 

To Download 68HC05JB4 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  ? motorola, inc., 1999 hc05jb4grs/h rev 2 68HC05JB4 68hc705jb4 specification (general release) february 24, 1999 semiconductor products sector motorola reserves the right to make changes without further notice to any products herein to improve reliability, function or design. motorola does not assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 i table of contents section page section 1 general description 1.1 features ...................................................................................................... 1-1 1.2 mask options.............................................................................................. 1-2 1.3 mcu structure.......................................................................................... 1-2 1.4 functional pin description.................................................................. 1-4 1.4.1 v dd and v ss .............................................................................................. 1-4 1.4.2 osc1, osc2 ............................................................................................... 1-4 1.4.3 reset ......................................................................................................... 1-6 1.4.4 irq (maskable interrupt request)................................................ 1-6 1.4.5 v3.3 ............................................................................................................. 1-6 1.4.6 d+ and d ................................................................................................... 1-6 1.4.7 pa0-pa7 ...................................................................................................... 1-6 1.4.8 pb0-pb4 ...................................................................................................... 1-7 1.4.9 pc0-pc5...................................................................................................... 1-7 section 2 memory 2.1 i/o and control registers ................................................................... 2-2 2.2 ram ................................................................................................................. 2-2 2.3 rom................................................................................................................. 2-2 2.4 i/o registers summary ........................................................................... 2-3 section 3 central processing unit 3.1 registers .................................................................................................... 3-1 3.2 accumulator (a)........................................................................................ 3-2 3.3 index register (x) ..................................................................................... 3-2 3.4 stack pointer (sp) .................................................................................... 3-2 3.5 program counter (pc) ........................................................................... 3-2 3.6 condition code register (ccr) ........................................................... 3-3 3.6.1 half carry bit (h-bit) .................................................................................... 3-3 3.6.2 interrupt mask (i-bit) .................................................................................... 3-3 3.6.3 negative bit (n-bit) ...................................................................................... 3-3 3.6.4 zero bit (z-bit) ............................................................................................. 3-3 3.6.5 carry/borrow bit (c-bit) ............................................................................... 3-4 section 4 interrupts 4.1 interrupt vectors .................................................................................. 4-1 4.2 interrupt processing............................................................................ 4-2 4.3 reset interrupt sequence .................................................................. 4-4 4.4 software interrupt (swi) ..................................................................... 4-4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 ii rev 2 table of contents section page 4.5 hardware interrupts ............................................................................ 4-4 4.5.1 external interrupt irq.................................................................................. 4-4 4.5.2 external interrupt irq2................................................................................ 4-5 4.5.3 irq control/status register (icsr) - $0a................................................... 4-6 4.5.4 port a external interrupts (pa0-pa3, by mask option) ................................ 4-7 4.5.5 timer1 interrupt (timer1)........................................................................... 4-8 4.5.6 usb interrupt (usb) .................................................................................... 4-8 4.5.7 mft interrupt (mft) .................................................................................... 4-8 section 5 resets 5.1 power-on reset ........................................................................................ 5-2 5.2 external reset ......................................................................................... 5-2 5.3 internal resets ........................................................................................ 5-2 5.3.1 power-on reset (por) ............................................................................... 5-2 5.3.2 usb reset ................................................................................................... 5-3 5.3.3 computer operating properly (cop) reset ................................................ 5-3 5.3.4 low voltage reset (lvr) ............................................................................ 5-3 5.3.5 illegal address reset................................................................................... 5-4 section 6 low power modes 6.1 stop mode.................................................................................................... 6-3 6.2 wait mode .................................................................................................... 6-3 6.3 data-retention mode.............................................................................. 6-3 section 7 input/output ports 7.1 slow falling-edge output driver..................................................... 7-1 7.2 port-a............................................................................................................ 7-2 7.2.1 port-a data register.................................................................................... 7-2 7.2.2 port-a data direction register .................................................................... 7-3 7.2.3 port-a pull-up control register ................................................................... 7-3 7.3 port-b............................................................................................................ 7-3 7.3.1 port-b data register.................................................................................... 7-4 7.3.2 port-b data direction register .................................................................... 7-4 7.3.3 port-b pull-up control register ................................................................... 7-4 7.4 port-c ........................................................................................................... 7-4 7.4.1 port-c data register ................................................................................... 7-5 7.4.2 port-c data direction register .................................................................... 7-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 iii table of contents section page section 8 multi-function timer 8.1 overview...................................................................................................... 8-2 8.2 computer operating properly (cop) watchdog ........................ 8-2 8.3 mft registers ............................................................................................ 8-3 8.3.1 timer counter register (tcnt) $09 ........................................................... 8-3 8.3.2 timer control/status register (tcsr) $08 ................................................. 8-3 8.4 operation during stop mode .............................................................. 8-4 8.5 cop consideration during stop mode............................................. 8-4 section 9 16-bit timer 9.1 timer registers (tmrh, tmrl)............................................................... 9-2 9.2 alternate counter registers (acrh, acrl) .................................. 9-4 9.3 input capture registers ...................................................................... 9-5 9.4 output compare registers ................................................................. 9-6 9.5 timer control register (tcr) ............................................................. 9-8 9.6 timer status register (tsr)................................................................. 9-9 9.7 timer operation during wait mode................................................. 9-10 9.8 timer operation during stop mode ................................................ 9-10 section 10 universal serial bus module 10.1 features .................................................................................................... 10-1 10.2 overview.................................................................................................... 10-2 10.2.1 usb protocol ............................................................................................. 10-2 10.2.2 reset signaling.......................................................................................... 10-8 10.2.3 suspend..................................................................................................... 10-9 10.2.4 resume after suspend.............................................................................. 10-9 10.2.5 low speed device................................................................................... 10-10 10.3 clock requirements........................................................................... 10-10 10.4 hardware description....................................................................... 10-10 10.4.1 voltage regulator .................................................................................... 10-11 10.4.2 usb transceiver...................................................................................... 10-11 10.4.3 receiver characteristics.......................................................................... 10-12 10.4.4 usb control logic ................................................................................... 10-14 10.5 i/o register description ................................................................... 10-17 10.5.1 usb address register (uaddr)............................................................. 10-18 10.5.2 usb interrupt register 0 (uir0) .............................................................. 10-19 10.5.3 usb interrupt register 1 (uir1) .............................................................. 10-20 10.5.4 usb control register 0 (ucr0) .............................................................. 10-21 10.5.5 usb control register 1 (ucr1) .............................................................. 10-22 10.5.6 usb control register 2 (ucr2) .............................................................. 10-23 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 iv rev 2 table of contents section page 10.5.7 usb status register (usr)..................................................................... 10-25 10.5.8 usb endpoint 0 data registers (ue0d0-ue0d7)................................... 10-25 10.5.9 usb endpoint 1/endpoint 2 data registers (ue1d0-ue1d7) ................ 10-26 10.6 usb interrupts...................................................................................... 10-26 10.6.1 usb end of transaction interrupt............................................................ 10-26 10.6.2 resume interrupt ..................................................................................... 10-27 10.6.3 end of packet interrupt ............................................................................ 10-27 section 11 analog to digital converter 11.1 adc operation ......................................................................................... 11-2 11.2 adc status and control register (adscr).................................. 11-3 11.3 adc data register (addr) .................................................................... 11-4 11.4 adc during low power modes .......................................................... 11-5 section 12 instruction set 12.1 addressing modes ................................................................................. 12-1 12.1.1 inherent...................................................................................................... 12-1 12.1.2 immediate .................................................................................................. 12-1 12.1.3 direct ......................................................................................................... 12-2 12.1.4 extended.................................................................................................... 12-2 12.1.5 indexed, no offset..................................................................................... 12-2 12.1.6 indexed, 8-bit offset .................................................................................. 12-2 12.1.7 indexed, 16-bit offset ................................................................................ 12-3 12.1.8 relative...................................................................................................... 12-3 12.1.9 instruction types ....................................................................................... 12-3 12.1.10 register/memory instructions .................................................................... 12-4 12.1.11 read-modify-write instructions ................................................................. 12-5 12.1.12 jump/branch instructions .......................................................................... 12-5 12.1.13 bit manipulation instructions...................................................................... 12-7 12.1.14 control instructions.................................................................................... 12-7 12.1.15 instruction set summary ........................................................................... 12-8 section 13 electrical specifications 13.1 maximum ratings..................................................................................... 13-1 13.2 thermal characteristics ................................................................... 13-1 13.3 dc electrical characteristics........................................................ 13-2 13.4 usb dc electrical characteristics ............................................... 13-3 13.5 usb low speed source electrical characteristics............... 13-4 13.6 control timing ........................................................................................ 13-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 v table of contents section page section 14 mechanical specifications 14.1 28-pin pdip (case 710) .............................................................................. 14-1 14.2 28-pin soic (case 751f)............................................................................ 14-1 appendix a mc68hc705jb4 a.1 introduction..............................................................................................a-1 a.2 memory .........................................................................................................a-1 a.3 mask option register (mor) .................................................................a-1 a.4 bootstrap mode .......................................................................................a-2 a.5 eprom programming ...............................................................................a-3 a.5.1 eprom program control register (pcr)...................................................a-3 a.5.2 programming sequence ..............................................................................a-3 a.6 eprom programming specifications ................................................a-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 vi rev 2 table of contents section page f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 vii list of figures figure title page 1-1 mc68HC05JB4 block diagram........................................................................ 1-3 1-2 mc68HC05JB4 pin assignment ...................................................................... 1-4 1-3 oscillator connections ..................................................................................... 1-5 2-1 mc68HC05JB4 memory map .......................................................................... 2-1 2-2 mc68HC05JB4 i/o registers $0000-$000f.................................................... 2-3 2-3 mc68HC05JB4 i/o registers $0010-$001f.................................................... 2-4 2-4 mc68HC05JB4 i/o registers $0020-$002f.................................................... 2-5 2-5 mc68HC05JB4 i/o registers $0030-$003f.................................................... 2-6 2-6 cop register (copr) ..................................................................................... 2-6 3-1 mc68hc05 programming model ..................................................................... 3-1 4-1 interrupt stacking order................................................................................... 4-2 4-2 interrupt flowchart ........................................................................................... 4-3 4-3 external interrupt (irq) logic .......................................................................... 4-5 4-4 external interrupt (irq2) logic ........................................................................ 4-6 4-5 irq control and status register (icsr)......................................................... 4-6 5-1 reset sources.................................................................................................. 5-1 5-2 cop watchdog register (copr) ................................................................... 5-3 6-1 stop and wait flowchart.............................................................................. 6-2 7-1 slow falling-edge output driver ...................................................................... 7-1 8-1 multi-function timer block diagram ................................................................ 8-1 8-2 timer counter register.................................................................................... 8-3 8-3 timer control/status register (tcsr)............................................................. 8-3 9-1 programmable timer block diagram ............................................................... 9-1 9-2 programmable timer counter block diagram ................................................. 9-2 9-3 programmable timer counter registers (tmrh, tmrl)................................ 9-3 9-4 alternate counter block diagram..................................................................... 9-4 9-5 alternate counter registers (acrh, acrl).................................................... 9-4 9-6 timer input capture block diagram................................................................. 9-5 9-7 input capture registers (icrh, icrl)............................................................. 9-6 9-8 timer output compare block diagram ............................................................ 9-7 9-9 output compare registers (ocrh, ocrl) .................................................... 9-7 9-10 timer control register (tcr) .......................................................................... 9-8 9-11 timer status registers (tsr) .......................................................................... 9-9 10-1 usb block diagram ....................................................................................... 10-2 10-2 supported transaction types per endpoint................................................... 10-3 10-3 supported usb packet types ....................................................................... 10-4 10-4 sync pattern................................................................................................... 10-4 10-5 sop, sync signaling and voltage levels ...................................................... 10-5 10-6 crc block diagram for address and endpoint fields................................... 10-6 10-7 crc block diagram for data packets ........................................................... 10-7 10-8 eop transaction voltage levels ................................................................... 10-8 10-9 eop width timing.......................................................................................... 10-8 10-10 external low speed device configuration................................................... 10-10 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 viii rev 2 list of figures figure title page 10-11 regulator electrical connections ................................................................. 10-11 10-12 low speed driver signal waveforms .......................................................... 10-12 10-13 differential input sensitivity over entire common mode range ................. 10-13 10-14 data jitter..................................................................................................... 10-14 10-15 data signal rise and fall time.................................................................... 10-14 10-16 nrzi data encoding .................................................................................... 10-15 10-17 flow diagram for nrzi ................................................................................ 10-15 10-18 bit stuffing.................................................................................................... 10-16 10-19 flow diagram for bit stuffing ....................................................................... 10-17 10-20 usb address register (uaddr) ................................................................. 10-18 10-21 usb interrupt register 0 (uir0) .................................................................. 10-19 10-22 usb interrupt register 1(uir1) ................................................................... 10-20 10-23 usb control register 0 (ucr0)................................................................... 10-21 10-24 usb control register 1 (ucr1)................................................................... 10-22 10-25 usb control register 2 (ucr2)................................................................... 10-23 10-26 usb status register (usr) ......................................................................... 10-25 10-27 usb endpoint 0 data register (ue0d0-ue0d7)......................................... 10-25 10-28 usb endpoint 1/endpoint2 data registers (ue1d0-ue1d7)...................... 10-26 10-29 out token data flow for receive endpoint 0 ............................................ 10-28 10-30 setup token data flow for receive endpoint 0........................................ 10-29 10-31 in token data flow for transmit endpoint 0 ............................................... 10-30 10-32 in token data flow for transmit endpoint 1/2 ............................................ 10-31 11-1 adc converter block diagram ...................................................................... 11-1 11-2 a/d status and control register .................................................................... 11-3 11-3 a/d data register .......................................................................................... 11-4 a-1 mc68hc705jb4 memory map ........................................................................a-2 a-2 eprom programming sequence ....................................................................a-4 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 ix list of tables table title page 4-1 reset/interrupt vector addresses .................................................................... 4-1 8-1 rti and cop rates at f op =3.0mhz................................................................ 8-2 10-1 supported packet identifiers .......................................................................... 10-5 10-2 register summary ....................................................................................... 10-17 11-1 a/d channel assignments ............................................................................. 11-4 12-1 register/memory instructions ........................................................................ 12-4 12-2 read-modify-write instructions...................................................................... 12-5 12-3 jump and branch instructions........................................................................ 12-6 12-4 bit manipulation instructions .......................................................................... 12-7 12-5 control instructions ........................................................................................ 12-7 12-6 instruction set summary............................................................................... 12-8 12-7 opcode map................................................................................................. 12-14 13-1 dc electrical characteristics.......................................................................... 13-2 13-2 usb dc electrical characteristics ................................................................. 13-3 13-3 usb low speed source electrical characteristics ........................................ 13-4 13-4 control timing................................................................................................ 13-5 a-1 eprom programming electrical characteristics .............................................a-5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 x rev 2 list of tables table title page f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 general description motorola rev 2 1-1 section 1 general description the mc68HC05JB4 is a member of the low-cost, high-performance m68hc05 family of 8-bit microcontroller units (mcus). the m68hc05 family is based on the customer-speci?d integrated circuit (csic) design strategy. all mcus in the family use the popular m68hc05 central processing unit (cpu) and are available with a variety of subsystems, memory sizes and types, and package types. the mc68HC05JB4 is speci?ally designed to be used in applications where a low speed (1.5mbps) universal serial bus (usb) interface is required. 1.1 features industry standard m68hc05 cpu core memory-mapped input/output (i/o) registers 3584 bytes of user rom 176 bytes of user ram (includes 64 byte stack) 19 bidirectional i/o pins with the following added features: pa[0:7]: software enable internal pull-up resistor (50k w typical) pa[0:3]: built-in schmitt triggered input level maskable as extra input sources for irq interrupt maskable negative-edge only or negative-edge and low-level interrupt capability pa4: irq2 with built-in schmitt triggered input pa[5:7]: 10ma sink output drive pa[6:7]: maskable 10ma/25ma sink output drive software enable slow edge pull down devices pb[0:4]: software enable internal pull-up resistor (50k w typical) software enable slow edge pull down devices pb[0]: icap1 with built-in schmitt triggered input pb[3:4]: ad[4:5] pc[0:3]: ad[0:3] f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola general description mc68HC05JB4 1-2 rev 2 fully compliant to low speed usb with 3 endpoints: 1 control endpoint (2x8 byte buffer) 2 interrupt endpoints (1x8 byte buffer shared) 6-channel 8-bit analog-to-digital converter (adc) multi-function timer (mft) 16-bit timer with 1 input capture and 1 output compare low voltage reset (lvr) circuit computer operating properly (cop) watchdog reset provide a 3.3v 10% dc voltage for usb pull-up resistor fully static operation with no minimum clock speed illegal address reset power-saving stop and wait modes available in 28-pin pdip and 28-pin soic packages 1.2 mask options the following mask options are available: enable pa0 to pa3 as extra irq interrupt sources. external interrupt pins (irq , pa0 to pa3): negative edge-triggered or negative edge- and low level-triggered. high current (25ma) output on pa6 and pa7. osc: crystal/ceramic resonator start up delay, 4064 or 128 clock cycles. lvr: enabled or disabled. cop: enabled or disabled. 1.3 mcu structure figure 1-1 shows the structure of mc68HC05JB4 mcu. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 general description motorola rev 2 1-3 figure 1-1. mc68HC05JB4 block diagram cond code reg 1 1 1 i n z c h index reg cpu control 0 0 0 stk pntr 1 1 0 0 0 0 0 alu 68hc05 cpu accum program counter cpu regis- pa0 pa7 pa6 pa5 pa4/irq2 pa3 pa2 pa1 pb0/icap1 pb4/ad5 pb3/ad4 pb2 pb1 osc 1 osc 2 reset irq (icap1) d+ d vdd vss v3.3 pc0/ad0 pc1/ad1 pc2/ad2 pc3/ad3 pc4/vrh pc5/vrl 8-bit adc 176 bytes ram 3584 bytes rom low speed usb 16-bit timer core timer osc ? reset and irq lvr vref power supply port a data direction reg. a port b data direction reg. b port c data direction reg. c shared with pb0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola general description mc68HC05JB4 1-4 rev 2 figure 1-2. mc68HC05JB4 pin assignment 1.4 functional pin description the following paragraphs give a description of the general function of each pin assigned in fig. 1-2 and fig. 1-3. 1.4.1 v dd and v ss power is supplied to the mcu through v dd and v ss . v dd is the positive supply, and v ss is ground. the mcu operates from a single power supply. very fast signal transitions occur on the mcu pins. the short rise and fall times place very high short-duration current demands on the power supply. to prevent noise problems, special care should be taken to provide good power supply bypassing at the mcu by using bypass capacitors with good high-frequency char- acteristics that are positioned as close to the mcu as possible. bypassing requirements vary, depending on how heavily the mcu pins are loaded. 1.4.2 osc1, osc2 the osc1 and osc2 pins are the connections for the on-chip oscillator. the osc1 and osc2 pins can accept the following sets of components: 1. a crystal as shown in figure 1-3 (a) 2. a ceramic resonator as shown in figure 1-3 (a) 3. an external clock signal as shown in figure 1-3 (b) the frequency, f osc , of the oscillator or external clock source is divided by two to produce the internal operating frequency, f op . if the internal operating frequency is 3mhz, then the external oscillator frequency will be 6mhz. for ls usb 1.5mhz 28 27 26 25 24 23 22 21 20 19 18 1 2 3 4 5 6 7 8 9 10 11 pa5 vss pa4/irq2 irq pa6 pb2 reset osc1 osc2 pb3/ad4 pb4/ad5 pc0/ad0 pc2/ad2 pc1/ad1 pc4/vrh pc5/vrl 3.3v 12 13 14 pa2 pa3 17 16 15 d+ d vdd pc3/ad3 pa1 pa0 pa7 pb1 pb0/icap1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 general description motorola rev 2 1-5 frequency clock can be derived from a divided by 4 circuit. the type of oscillator is selected by a mask option. an internal 2m w resistor may be selected between osc1 and osc2 by a mask option (crystal/ceramic resonator mode only). crystal oscillator the circuit in figure 1-3 (a) shows a typical oscillator circuit for an at-cut, parallel resonant crystal. the crystal manufacturers recommendations should be fol- lowed, as the crystal parameters determine the external component values required to provide maximum stability and reliable start-up. the load capacitance values used in the oscillator circuit design should include all stray capacitances. the crystal and components should be mounted as close as possible to the pins for start-up stabilization and to minimize output distortion. an internal start-up resistor of approximately 2 m w is provided between osc1 and osc2 for the crys- tal type oscillator as a mask option. figure 1-3. oscillator connections ceramic resonator oscillator in cost-sensitive applications, a ceramic resonator can be used in place of the crystal. the circuit in figure 1-3 (a) can be used for a ceramic resonator. the res- onator manufacturers recommendations should be followed, as the resonator parameters determine the external component values required for maximum sta- bility and reliable starting. the load capacitance values used in the oscillator cir- cuit design should include all stray capacitances. the ceramic resonator and components should be mounted as close as possible to the pins for start-up stabi- lization and to minimize output distortion. an internal start-up resistor of approxi- mately 2 m w is provided between osc1 and osc2 for the ceramic resonator type oscillator as a mask option. external clock an external clock from another cmos-compatible device can be connected to the osc1 input, with the osc2 input not connected, as shown in figure 1-3 (b).this con?uration is possible only when the crystal/ceramic resonator mask option is selected. mcu osc1 osc2 2m w unconnected external clock mcu osc1 osc2 (a) crystal or ceramic resonator connections (b) external clock source connection f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola general description mc68HC05JB4 1-6 rev 2 1.4.3 reset this is an i/o pin. this pin can be used as an input to reset the mcu to a known start-up state by pulling it to the low state. the reset pin contains a steering diode to discharge any voltage on the pin to v dd , when the power is removed. an internal pull-up is also connected between this pin and v dd . the reset pin con- tains an internal schmitt trigger to improve its noise immunity as an input. this pin is an output pin if lvr triggers an internal reset. 1.4.4 irq (maskable interrupt request) this input pin drives the asynchronous irq interrupt function of the cpu. the irq interrupt function has a mask option to provide either only negative edge-sensitive triggering or both negative edge-sensitive and low level-sensitive triggering. if the option is selected to include level-sensitive triggering, the irq input requires an external resistor to v dd for "wired-or" operation, if desired. the irq pin contains an internal schmitt trigger as part of its input to improve noise immunity. note each of the pa0 thru pa3 i/o pins may be connected as an or function with the irq interrupt function by a mask option. this capability allows keyboard scan applications where the transitions or levels on the i/o pins will behave the same as the irq pin. the edge or level sensitivity selected by a separate mask option for the irq pin also applies to the i/o pins or?d to create the irq signal. 1.4.5 v3.3 this is an output reference voltage nominally set at 3.3 volt dc. 1.4.6 d+ and d these two lines carry the usb differential data. for low speed device such as mc68HC05JB4, a 1.5 k w resistor is required to be connected across d?and 3.3v for proper signal termination. 1.4.7 pa0-pa7 these eight i/o lines comprise port-a. pa0 to pa7 are push-pull pins with internal pull-up resistors. the state of any pin is software programmable and all port a lines are con?ured as inputs during power-on or reset. the internal pull-up resis- tor on pa0-4 is software enable. the pa0 thru pa3 can be connected via an inter- nal nand gate to the irq interrupt function enabled by a mask option. pa5 thru pa7 has built in 10ma pull-down device for direct led drive. in addition, pa6 and pa7 both have slow falling edge control which is enabled by software and can sink 25ma current selectable by mask option. pa0 thru pa4 have built-in schmitt triggered input. pa4 can be used as an extra interrupt pin (irq2 ) when irq2 inter- rupt is enabled. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 general description motorola rev 2 1-7 1.4.8 pb0-pb4 these ?e i/o lines comprise port-b. pb0 to pb4 are push-pull pins with internal pull-up resistors. the state of any pin is software programmable and all port b lines are con?ured as inputs during power-on or reset. the internal pull-up resis- tor is software enable. in addition, all port-b pins have slow falling edge control which is enabled by software. pb0 can be used as the input capture pin when the input capture function is enabled on the 16-bit timer. pb0 has built-in schmitt trig- gered input. when the adc function is enabled, pb3 and pb4 can be used as extra two analog input channels (ad4 and ad5 respectively) to the adc. 1.4.9 pc0-pc5 these six i/o lines comprise port-c. pc0 to pc5 are push-pull pins. the state of any pin is software programmable and all port c lines are con?ured as inputs during power-on or reset. when the adc function is enabled, pc0 thru pc3 become the four analog input channels to the adc and pc4 and pc5 become the analog ?igh and ?ow reference voltages to the adc respectively. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola general description mc68HC05JB4 1-8 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 memory motorola rev 2 2-1 section 2 memory the mc68HC05JB4 has 8k-bytes of addressable memory, with 64 bytes of i/o, 176 bytes of user ram, and 3584 bytes of user rom, as shown in figure 2-1 . figure 2-1. mc68HC05JB4 memory map $1ff7 $1ff8 $1ff9 $1ffa $1ffb $1ffc $1ffd $1ffe $1fff $003f $0000 $1ff6 $1ff3 $1ff4 $1ff5 $1ff2 $1ff1 reserved usb vector (low byte) timer1 vector (low byte) usb vector (high byte) timer1 vector (high byte) mft vector (low byte) mft vector (high byte) reserved $1ff0 reserved reserved irq/irq2 vector (high byte) irq/irq2 vector (low byte) swi vector (high byte) swi vector (low byte) reset vector (high byte) reset vector (low byte) i/o registers 64 bytes i/o registers 64 bytes $0000 $003f $0040 $007f unused 64 bytes user ram 176 bytes 64 byte stack $0080 $00c0 $00ff $012f $0130 $0fff unused 3792 bytes $1000 $1dff $1e00 $1fef user rom 3584 bytes self-check rom 496 bytes user vectors 16 bytes $1ff0 $1fff f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola memory mc68HC05JB4 2-2 rev 2 2.1 i/o and control registers the i/o and control registers reside in locations $0000 to $003f. the bit assign- ments for each register are shown in figure 2-2 , figure 2-3 , figure 2-4 , and figure 2-5 . reading from unused bits will return unknown states, and writing to unused bits will be ignored. 2.2 ram the user ram consists of 176 bytes (including the stack) at locations $0080 to $012f. the stack begins at address $00ff and proceeds down to $00c0. using the stack area for data storage or temporary work locations requires care to pre- vent it from being overwritten due to stacking from an interrupt or subroutine call. 2.3 rom there are a total of 4k bytes of rom on chip. this includes 3584 bytes of user rom with locations $1000 to $1dff for user program storage and 16 bytes for user vectors at locations $1ff0 to $1fff. also, 496 bytes of self-check rom on chip at locations $1e00 to $1fef. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 memory motorola rev 2 2-3 2.4 i/o registers summary addr register r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $0000 port a data r pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 porta w $0001 port b data r 0 0 0 pb4 pb3 pb2 pb1 pb0 portb w $0002 port c data r 0 0 pc5 pc4 pc3 pc2 pc1 pc0 portc w $0003 unused r w $0004 port a data direction r ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 ddra w $0005 port b data direction r sloweasloweb 0 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 ddrb w $0006 port c data direction r 0 0 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 ddrc w $0007 unused r w $0008 mft ctrl/status r tof rtif tofe rtie 00 rt1 rt0 tcsr w tofr rtifr $0009 mft counter r tmr7 tmr6 tmr5 tmr4 tmr3 tmr2 tmr1 tmr0 tcnt w $000a irq control/status r irqe irq2e 0 0 irqf irq2f 0 0 icsr w irqr irq2r $000b unused r w $000c unused r w $000d unused r w $000e adc control/status r coco adrc adon 0 ch3 ch2 ch1 ch0 adscr w $000f adc data r addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 addr w unused bits reserved bits figure 2-2. mc68HC05JB4 i/o registers $0000-$000f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola memory mc68HC05JB4 2-4 rev 2 addr register r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $0010 port a pull-up r pura w pura7 pura6 pura5 pura4 pura3 pura2 pura1 pura0 $0011 port b pull-up r purb w purb4 purb3 purb2 purb1 purb0 $0012 timer1 control r icie ocie toie 000 iedg 0 tcr w $0013 timer1 status r icf ocf tof 00000 tsr w $0014 input capture msb r ich7 ich6 ich5 ich4 ich3 ich2 ich1 ich0 ich w $0015 input capture lsb r icl7 icl6 icl5 icl4 icl3 icl2 icl1 icl0 icl w $0016 output compare msb r och7 och6 och5 och4 och3 och2 och1 och0 och w $0017 output compare lsb r ocl7 ocl6 ocl5 ocl4 ocl3 ocl2 ocl1 ocl0 ocl w $0018 timer1 counter msb r tcnth7 tcnth6 tcnth5 tcnth4 tcnth3 tcnth2 tcnth1 tcnth0 tcnth w $0019 timer1 counter lsb r tcntl7 tcntl6 tcntl5 tcntl4 tcntl3 tcntl2 tcntl1 tcntl0 tcntl w $001a alter. counter msb r acnth7 acnth6 acnth5 acnth4 acnth3 acnth2 acnth1 acnth0 acnth w $001b alter. counter lsb r acntl7 acntl6 acntl5 acntl4 acntl3 acntl2 acntl1 acntl0 acntl w $001c unused r w $001d unused r w $001e unused r w $001f unused r w unused bits reserved bits figure 2-3. mc68HC05JB4 i/o registers $0010-$001f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 memory motorola rev 2 2-5 addr register r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $0020 usb endpoint 0 data 0 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r0 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0021 usb endpoint 0 data 1 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r1 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0022 usb endpoint 0 data 2 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r2 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0023 usb endpoint 0 data 3 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r3 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0024 usb endpoint 0 data 4 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r4 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0025 usb endpoint 0 data 5 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r5 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0026 usb endpoint 0 data 6 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r6 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0027 usb endpoint 0 data 7 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 ud0r7 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 $0028 usb endpoint 1 data 0 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r0 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 $0029 usb endpoint 1 data 1 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r1 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 $002a usb endpoint 1 data 2 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r2 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 $002b usb endpoint 1 data 3 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r3 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 $002c usb endpoint 1 data 4 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r4 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 $002d usb endpoint 1 data 5 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r5 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 $002e usb endpoint 1 data 6 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r6 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 $002f usb endpoint 1 data 7 r ue1rd7 ue1rd6 ue1rd5 ue1rd4 ue1rd3 ue1rd2 ue1rd1 ue1rd0 ud1r7 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 unused bits reserved bits figure 2-4. mc68HC05JB4 i/o registers $0020-$002f f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola memory mc68HC05JB4 2-6 rev 2 addr register r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $0030 unused r w $0031 unused r w $0032 unused r w $0033 unused r w $0034 unused r w $0035 unused r w $0036 unused r w $0037 usb control 2 r 0 tx1st enable2 enable1 stall2 stall1 ucr2 w tx1str $0038 usb address r usben uadd6 uadd5 uadd4 uadd3 uadd2 uadd1 uadd0 uadr w $0039 usb interrupt 0 r txd0f rxd0f rstf suspnd txd0ie rxd0ie 00 uir0 w 0 0 0 txd0fr rxd0fr $003a usb interrupt 1 r txd1f rxd1f resumf 0 txd1ie eopie 00 uir1 w 0 0 0 resumfr txd1fr eopfr $003b usb control 0 r t0seq stall0 tx0e rx0e tp0siz3 tp0siz2 tp0siz1 tp0siz0 ucr0 w $003c usb control 1 r t1seq endadd tx1e fresum tp1siz3 tp1siz2 tp1siz1 tp1siz0 ucr1 w $003d usb status r rseq setup rpsiz3 rpsiz2 rpsiz1 rpsiz0 usr w $003e reserved r w $003f reserved r w unused bits reserved bits figure 2-5. mc68HC05JB4 i/o registers $0030-$003f addr register r/w bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 $1ff0 cop register r 00000000 copr w copr figure 2-6. cop register (copr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 central processing unit motorola rev 2 3-1 section 3 central processing unit the mc68HC05JB4 has an 8k-bytes memory map. the stack has only 64 bytes. therefore, the stack pointer has been reduced to only 6 bits and will only decrement down to $00c0 and then wrap-around to $00ff. all other instructions and registers behave as described in this chapter. 3.1 registers the mcu contains ?e registers which are hard-wired within the cpu and are not part of the memory map. these ?e registers are shown in figure 3-1 and are described in the following paragraphs. figure 3-1. mc68hc05 programming model condition code register i accumulator 60 a index register 71 x 4 52 3 stack pointer sp 14 8 15 9 12 13 10 11 pc cc 111 11 0 0 0 0 0 0 0 0 program counter h nzc half-carry bit (from bit 3) interrupt mask negative bit zero bit carry bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola central processing unit mc68HC05JB4 3-2 rev 2 3.2 accumulator (a) the accumulator is a general purpose 8-bit register as shown in figure 3-1 . the cpu uses the accumulator to hold operands and results of arithmetic calculations or non-arithmetic operations. the accumulator is not affected by a reset of the device. 3.3 index register (x) the index register shown in figure 3-1 is an 8-bit register that can perform two functions: indexed addressing temporary storage in indexed addressing with no offset, the index register contains the low byte of the operand address, and the high byte is assumed to be $00. in indexed addressing with an 8-bit offset, the cpu ?ds the operand address by adding the index register content to an 8-bit immediate value. in indexed addressing with a 16-bit offset, the cpu ?ds the operand address by adding the index register content to a 16-bit immediate value. the index register can also serve as an auxiliary accumulator for temporary storage. the index register is not affected by a reset of the device. 3.4 stack pointer (sp) the stack pointer shown in figure 3-1 is a 16-bit register. in mcu devices with memory space less than 64k-bytes the unimplemented upper address lines are ignored. the stack pointer contains the address of the next free location on the stack. during a reset or the reset stack pointer (rsp) instruction, the stack pointer is set to $00ff. the stack pointer is then decremented as data is pushed onto the stack and incremented as data is pulled off the stack. when accessing memory, the ten most signi?ant bits are permanently set to 0000000011. the six least signi?ant register bits are appended to these ten ?ed bits to produce an address within the range of $00ff to $00c0. subroutines and interrupts may use up to 64($c0) locations. if 64 locations are exceeded, the stack pointer wraps around and overwrites the previously stored information. a subroutine call occupies two locations on the stack and an interrupt uses ?e locations. 3.5 program counter (pc) the program counter shown in figure 3-1 is a 16-bit register. in mcu devices with memory space less than 64k-bytes the unimplemented upper address lines are ignored. the program counter contains the address of the next instruction or operand to be fetched. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 central processing unit motorola rev 2 3-3 normally, the address in the program counter increments to the next sequential memory location every time an instruction or operand is fetched. jump, branch, and interrupt operations load the program counter with an address other than that of the next sequential location. 3.6 condition code register (ccr) the ccr shown in figure 3-1 is a 5-bit register in which four bits are used to indicate the results of the instruction just executed. the ?th bit is the interrupt mask. these bits can be individually tested by a program, and speci? actions can be taken as a result of their states. the condition code register should be thought of as having three additional upper bits that are always ones. only the interrupt mask is affected by a reset of the device. the following paragraphs explain the functions of the lower ?e bits of the condition code register. 3.6.1 half carry bit (h-bit) when the half-carry bit is set, it means that a carry occurred between bits 3 and 4 of the accumulator during the last add or adc (add with carry) operation. the half-carry bit is required for binary-coded decimal (bcd) arithmetic operations. 3.6.2 interrupt mask (i-bit) when the interrupt mask is set, the internal and external interrupts are disabled. interrupts are enabled when the interrupt mask is cleared. when an interrupt occurs, the interrupt mask is automatically set after the cpu registers are saved on the stack, but before the interrupt vector is fetched. if an interrupt request occurs while the interrupt mask is set, the interrupt request is latched. normally, the interrupt is processed as soon as the interrupt mask is cleared. a return from interrupt (rti) instruction pulls the cpu registers from the stack, restoring the interrupt mask to its state before the interrupt was encountered. after any reset, the interrupt mask is set and can only be cleared by the clear i-bit (cli), or wait instructions. 3.6.3 negative bit (n-bit) the negative bit is set when the result of the last arithmetic operation, logical operation, or data manipulation was negative. (bit 7 of the result was a logical one.) the negative bit can also be used to check an often tested ?g by assigning the ?g to bit 7 of a register or memory location. loading the accumulator with the contents of that register or location then sets or clears the negative bit according to the state of the ?g. 3.6.4 zero bit (z-bit) the zero bit is set when the result of the last arithmetic operation, logical operation, data manipulation, or data load operation was zero. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola central processing unit mc68HC05JB4 3-4 rev 2 3.6.5 carry/borrow bit (c-bit) the carry/borrow bit is set when a carry out of bit 7 of the accumulator occurred during the last arithmetic operation, logical operation, or data manipulation. the carry/borrow bit is also set or cleared during bit test and branch instructions and during shifts and rotates. this bit is neither set by an inc nor by a dec instruction. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 interrupts motorola rev 2 4-1 section 4 interrupts the mcu can be interrupted in seven different ways: non-maskable software interrupt instruction (swi) external asynchronous interrupt (irq ) external asynchronous interrupt (irq2 ) optional external interrupt via irq on pa0-pa3 (by a mask option) usb interrupt timer1 interrupt (16-bit timer) multi-function timer interrupt 4.1 interrupt vectors table 4-1. reset/interrupt vector addresses function source control bit global hardware mask local software mask priority (1 = highest) vector address reset power-on logic reset pin low voltage reset illegal address reset 1 $1ffe?1fff cop watchdog software interrupt (swi) user code same priority as instruction $1ffc?1ffd external interrupt (irq) irq pin irq2 pin i bit irqe bit irq2e bit 2 $1ffa?1ffb usb interrupts txd0f txd1f resump i bit txd0ie txd1ie 3 $1ff8?1ff9 timer1 interrupts icf bit ocf bit tof bit i bit icie bit ocie bit toie bit 4 $1ff6?1ff7 mft interrupts tof bit rtif i bit tofe bit rtie bit 5 $1ff4?1ff5 reserved $1ff2?1ff3 reserved $1ff0?1ff1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola interrupts mc68HC05JB4 4-2 rev 2 note if more than one interrupt request is pending, the cpu fetches the vector of the higher priority interrupt ?st. a higher priority interrupt does not actually interrupt a lower priority interrupt service routine unless the lower priority interrupt service routine clears the i bit. 4.2 interrupt processing the cpu does the following actions to begin servicing an interrupt: stores the cpu registers on the stack in the order shown in figure 4-1 . sets the i bit in the condition code register to prevent further interrupts. loads the program counter with the contents of the appropriate interrupt vector locations as shown in table 4-1 . the return from interrupt (rti) instruction causes the cpu to recover its register contents from the stack as shown in figure 4-1 . the sequence of events caused by an interrupt are shown in the ?w chart in figure 4-2 . $0020 (bottom of ram) $0021 $00be $00bf $00c0 (bottom of stack) $00c1 $00c2 unstacking order ? n condition code register 5 1 n+1 accumulator 4 2 n+2 index register 3 3 n+3 program counter (high byte) 2 4 n+4 program counter (low byte) 1 5 y stacking $00fd order $00fe $00ff top of stack (ram) figure 4-1. interrupt stacking order f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 interrupts motorola rev 2 4-3 i figure 4-2. interrupt flowchart no external interrupt? i bit set? from reset yes yes clear irq latch. no execute instruction. unstack ccr, a, x, pch, pcl. fetch next instruction. stack pcl, pch, x, a, ccr. set i bit. load pc with interrupt vector. usb interrupt? yes no timer1 interrupt? yes no mft interrupt? yes no swi instruction? yes no rti instruction? yes no f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola interrupts mc68HC05JB4 4-4 rev 2 4.3 reset interrupt sequence the reset function is not in the strictest sense an interrupt; however, it is acted upon in a similar manner as shown in figure 4-2 . a low level input on the reset pin or an internally generated rst signal causes the program to vector to its start- ing address which is speci?d by the contents of memory locations $1ffe and $1fff. the i-bit in the condition code register is also set. 4.4 software interrupt (swi) the swi is an executable instruction and a non-maskable interrupt since it is exe- cuted regardless of the state of the i-bit in the ccr. as with any instruction, inter- rupts pending during the previous instruction will be serviced before the swi opcode is fetched. the interrupt service routine address is speci?d by the con- tents of memory locations $1ffc and $1ffd. 4.5 hardware interrupts all hardware interrupts except reset are maskable by the i-bit in the ccr. if the i-bit is set, all hardware interrupts (internal and external) are disabled. clearing the i-bit enables the hardware interrupts. there are two types of hardware inter- rupts which are explained in the following sections. 4.5.1 external interrupt irq the irq pin provides an asynchronous interrupt to the cpu. a block diagram of the irq logic is shown in figure 4-3 . the irq pin is one source of an irq interrupt and a mask option can also enable the four lower port a pins (pa0 to pa3) to act as other irq interrupt sources. refer to figure 4-3 for the following descriptions. irq interrupt source comes from irq latch. the irq latch will be set on the falling edge of the irq pin or on any falling edge of pa0-3 pins if pa0-3 interrupts have been enabled. if ?dge-only sensitivity is chosen by a mask option, only the irq latch output can activate an irqf ?g which creates a request to the cpu to generate the irq interrupt sequence. this makes the irq interrupt sensitive to the following cases: 1. falling edge on the irq pin. 2. falling edge on any pa0-pa3 pin with irq enabled (via mask option). if level sensitivity is chosen, the active high state of the signal to the clock input of the irq latch can also activate an irqf ?g which creates an irq request to the cpu to generate the irq interrupt sequence. this makes the irq interrupt sensi- tive to the following cases: 1. low level on the irq pin. 2. falling edge on the irq pin. 3. low level on any pa0- pa3 pin with irq enabled (via mask option). 4. falling edge on any pa0- pa3 pin with irq enabled (via mask option). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 interrupts motorola rev 2 4-5 the irqe enable bit controls whether an active irqf ?g can generate an irq interrupt sequence. this interrupt is serviced by the interrupt service routine located at the address speci?d by the contents of $1ffa and $1ffb. if irqf is set, the only way to clear this ?g is by writing a logic one to the irqr acknowledge bit in the icsr. as long as the output state of the irqf ?g bit is active the cpu will continuously re-enter the irq interrupt sequence until the active state is removed or the irqe enable bit is cleared. figure 4-3. external interrupt (irq) logic 4.5.2 external interrupt irq2 the irq2 /pa4 pin provides an asynchronous interrupt to the cpu. when a nega- tive-edge is detected by the schmitt trigger input, an irq2 interrupt will be gener- ated if the irq2e-bit in the icsr register is set. this interrupt is serviced by the interrupt service routine located at the address speci?d by the contents of $1ffa and $1ffb. a block diagram of the irq2 function is shown in figure 4-4 . irq irq latch v dd rst irq vector fetch irq status/control register external interrupt request irqe irqf irqr internal data bus to bih & bil instruction processing r irq level (mask option) pa 0 pa 1 pa 2 pa 3 port a external interrupt (mask option) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola interrupts mc68HC05JB4 4-6 rev 2 figure 4-4. external interrupt (irq2) logic 4.5.3 irq control/status register (icsr) - $0a the irq interrupt function is controlled by the icsr located at $000a. all unused bits in the icsr will read as logic zeros. the irqf bit is cleared and irqe bit is set by reset. irqr ?irq interrupt acknowledge the irqr acknowledge bit clears an irq interrupt by clearing the irq latch. the irqr acknowledge bit will always read as a logic zero. 1 = writing a logic one to the irqr acknowledge bit will clear the irq latch. 0 = writing a logic zero to the irqr acknowledge bit will have no effect on the irq latch. irqf ?irq interrupt request flag writing to the irqf ?g bit will have no effect on it. if the additional setting of irqf ?g bit is not cleared in the irq service routine and the irqe enable bit remains set the cpu will re-enter the irq interrupt sequence continuously until either the irqf ?g bit or the irqe enable bit is clear. the irqf latch is cleared by reset. 1 = indicates that an irq request is pending. 0 = indicates that no irq request triggered by pins pa0-3 or irq is pending. the irqf ?g bit can be cleared by writing a logic one to the irqr acknowledge bit to clear the irq latch and also conditioning the external irq sources to be inactive (if the level sensitive interrupts are enabled via mask option). doing so before exiting the service routine will mask out additional occurrences of the irqf. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icsr r irqe irq2e 0 0 irqf irq2f 0 0 $000a w irqr irq2r reset: 10000000 figure 4-5. irq control and status register (icsr) ir q2 irq2 latch v dd irq2 interrupt r irq2e irq2r icsr ($0a) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 interrupts motorola rev 2 4-7 irqe ?irq interrupt enable the irqe bit enables/disables the irqf ?g bit to initiate an irq interrupt sequence. 1 = enables irq interrupt, that is, the irqf ?g bit can generate an interrupt sequence. reset sets the irqe enable bit, thereby enabling irq interrupts once the i-bit is cleared. execution of the stop or wait instructions causes the irqe bit to be set in order to allow the external irq to exit these modes. 0 = the irqf ?g bit cannot generate an interrupt sequence. irq2r ?irq2 interrupt acknowledge the irq2r acknowledge bit clears an irq2 interrupt by clearing the irq2 latch. the irq2r acknowledge bit will always read as a logic zero. 1 = writing a logic one to the irq2r acknowledge bit will clear the irq2 latch. 0 = writing a logic zero to the irq2r acknowledge bit will have no effect on the irq2 latch. irq2f ?irq2 interrupt request flag writing to the irq2f ?g bit will have no effect on it. if the additional setting of irq2f ?g bit is not cleared in the irq2 service routine and the irq2e enable bit remains set the cpu will re-enter the irq2 interrupt sequence continuously until either the irq2f ?g bit or the irq2e enable bit is clear. the irq2f latch is cleared by reset. 1 = indicates that an irq2 request is pending. 0 = indicates that no irq2 request triggered by pins pa4. the irq2f ?g bit can be cleared by writing a logic one to the irq2r acknowledge bit to clear the irq2 latch. irq2e - irq2 interrupt enable the irq2e bit enables/disables the irq2f ?g bit to initiate an irq2 interrupt sequence. 1 = enables irq2 interrupt, that is, the irq2f ?g bit can generate an interrupt sequence. reset clears the irq2e enable bit. 0 = the irq2f ?g bit cannot generate an interrupt sequence. 4.5.4 port a external interrupts (pa0-pa3, by mask option) the irq interrupt can also be triggered by the inputs on the pa0 to pa3 port pins if enabled by a single mask option. if enabled, the lower four bits of port a can activate the irq interrupt function, and the interrupt operation will be the same as for inputs to the irq pin. this mask option of pa0-3 interrupt allow all of these input pins to be or?d with the input present on the irq pin. all pa0 to pa3 pins must be selected as a group as an additional irq interrupt. all the pa0-3 interrupt sources are also controlled by the irqe enable bit. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola interrupts mc68HC05JB4 4-8 rev 2 note the bih and bil instructions will only apply to the level on the irq pin itself, and not to the output of the logic or function with the pa0 to pa3 pins. the state of the individual port a pins can be checked by reading the appropriate port a pins as inputs. note if enabled, the pa0 to pa3 pins will cause an irq interrupt only when the corresponding pin is con?ured as input. 4.5.5 timer1 interrupt (timer1) the timer1 interrupt is generated by the 16-bit timer when either an over?w or an input capture or output compare has occurred as described in the section on 16-bit timer. the interrupt ?gs and enable bits for the timer1 interrupts are located in the timer1 control & status register (tsr) located at $0012, $0013. the i-bit in the ccr must be clear in order for the timer1 interrupt to be enabled. either of these three interrupts will vector to the same interrupt service routine located at the address speci?d by the contents of memory locations $1ff6 and $1ff7. 4.5.6 usb interrupt (usb) the usb interrupt is generated by the usb module as described in the section on universal serial bus. the interrupt enable bits for the usb interrupt are located at bit3-bit2 of uir0 reg and bit3-bit2 of uir1 reg. also once the device goes into suspend mode, any bus activities will cause the usb to generate an interrupt to cpu to come out from the suspend mode. the i-bit in the ccr must be clear in order for the usb interrupt to be enabled. either of these two interrupts will vector to the same interrupt service routine located at the address speci?d by the con- tents of memory locations $1ff8 and $1ff9. 4.5.7 mft interrupt (mft) the mft interrupt is generated by the mft module as described in the section on multi-function timer. these interrupts will vector to the same interrupt service rou- tine located at the address speci?d by the contents of memory locations $1ff4 and $1ff5. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 resets motorola rev 2 5-1 section 5 resets this section describes the six reset sources and how they initialize the mcu. a reset immediately stops the operation of the instruction being executed, initializes certain control bits, and loads the program counter with a user de?ed reset vec- tor address. the following conditions produce a reset: initial power up of device (power on reset). a logic zero applied to the reset pin (external reset). timeout of the cop watchdog (cop reset). low voltage applied to the device (lvr reset). fetch of an opcode from an address not in the memory map (illegal address reset). detection of usb reset signal (usb reset). figure 5-1 shows a block diagram of the reset sources and their interaction. figure 5-1. reset sources reset reset latch r cop watchdog power-on reset illegal address reset internal d internal clock s rst to cpu and low voltage reset v dd subsystems address bus usb reset detection f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola resets mc68HC05JB4 5-2 rev 2 5.1 power-on reset a positive transition on the v dd pin generates a power-on reset. the power-on reset is strictly for conditions during powering up and cannot be used to detect drops in power supply voltage. a 4064 t cyc (internal clock cycle) delay after the oscillator becomes active allows the clock generator to stabilize. if the reset pin is at logic zero at the end of the multiple t cyc time, the mcu remains in the reset condition until the signal on the reset pin goes to a logic one. 5.2 external reset a logic zero applied to the reset pin for 1.5t cyc generates an external reset. this pin is connected to a schmitt trigger input gate to provide and upper and lower threshold voltage separated by a minimum amount of hysteresis. the exter- nal reset occurs whenever the reset pin is pulled below the lower threshold and remains in reset until the reset pin rises above the upper threshold. this active low input will generate the internal rst signal that resets the cpu and peripher- als. the reset pin can also act as an open drain output. it will be pulled to a low state by an internal pulldown device that is activated by three internal reset sources. this reset pulldown device will only be asserted for 3 - 4 cycles of the internal clock, f op , or as long as the internal reset source is asserted. when the external reset pin is asserted, the pulldown device will not be turned on. note do not connect the reset pin directly to v dd , as this may overload some power supply designs when the internal pulldown on the reset pin activates. 5.3 internal resets the ?e internally generated resets are the initial power-on reset function, the cop watchdog timer reset, the low voltage reset, and the illegal address detector. only the cop watchdog timer reset, low voltage reset and illegal address detec- tor will also assert the pulldown device on the reset pin for the duration of the reset function or 3 - 4 internal clock cycles, whichever is longer. 5.3.1 power-on reset (por) the internal por is generated on power-up to allow the clock oscillator to stabi- lize. the por is strictly for power turn-on conditions and is not able to detect a drop in the power supply voltage (brown-out). there is an oscillator stabilization delay of 4064 internal processor bus clock cycles after the oscillator becomes active. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 resets motorola rev 2 5-3 the por will generate the rst signal which will reset the cpu. if any other reset function is active at the end of the 4064 cycle delay, the rst signal will remain in the reset condition until the other reset condition(s) end. por will not activate the pulldown device on the reset pin. v dd must drop below v por in order for the internal por circuit to detect the next rise of v dd . 5.3.2 usb reset the usb reset is generated by a detection on the usb bus reset signal. for mc68HC05JB4, seeing a single-end zero on its upstream port for 4 to 8 bit times will set rstf bit in uir0 register. the detections will also generate the rst signal to reset the cpu and other peripherals in the mcu. 5.3.3 computer operating properly (cop) reset the cop watchdog is enabled by a mask option. a timeout of the cop watchdog generates a cop reset. the cop watchdog is part of a software error detection system and must be cleared periodically to start a new timeout period. to clear the cop watchdog and prevent a cop reset, write a logic zero to the copc bit of the cop register at location $1ff0. copc ?cop clear copc is a write-only bit. periodically writing a logic zero to copc prevents the cop watchdog from resetting the mcu. reset clears the copc bit. 1 = no effect on system. 0 = reset cop watchdog timer. the cop watchdog reset will assert the pulldown device to pull the reset pin low for one cycle of the internal bus clock. see section on core timer for detail on cop watchdog timeout periods. 5.3.4 low voltage reset (lvr) the lvr activates the rst reset signal to reset the device when the voltage on the v dd pin falls below the lvr trip voltage. the lvr will assert the pulldown device to pull the reset pin low one cycle of the internal bus clock. the low volt- age reset circuit is enabled by a mask option. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 copr r 00000000 $1ff0 w copc reset: uuuuuuu0 u = unaffected by reset figure 5-2. cop watchdog register (copr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola resets mc68HC05JB4 5-4 rev 2 5.3.5 illegal address reset an opcode fetch from an address that is not in the rom (locations $1000 to $1fff) or the ram (locations $0080 to $012f) generates an illegal address reset. the illegal address reset will assert the pulldown device to pull the reset pin low for 3 to 4 cycles of the internal bus clock. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 low power modes motorola rev 2 6-1 section 6 low power modes there are three modes of operation that reduce power consumption: stop mode wait mode data retention mode figure 6-1 shows the sequence of events in stop and wait modes. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola low power modes mc68HC05JB4 6-2 rev 2 figure 6-1. stop and wait flowchart stop external reset? external interrupt? no no start stabilization delay yes yes end of stabilization delay? yes no wait restart internal processor clock 1. load pc with reset vector or 2. service interrupt. a. save cpu registers on stack. b. set i bit in ccr. c. load pc with interrupt vector. no external reset? yes no yes no external interrupt? yes no usb interrupt? yes reset or no yes irq2 interrupt? external yes no stop external oscillator, stop internal timer clock, reset start-up delay stop internal processor clock, clear i-bit in ccr, set irqe in icsr external interrupt? usb interrupt no no yes yes irq irq2 or reset? restart external oscillator, irq timer1 interrupt? internal mft interrupt? internal external oscillator active, internal timer clock active stop internal processor clock, clear i-bit in ccr, set irqe in icsr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 low power modes motorola rev 2 6-3 6.1 stop mode stop mode is entered by executing the stop instruction. this is the lowest power consumption mode of the mcu. in the stop mode the internal oscillator is turned off, halting all internal processing. execution of the stop instruction automatically clears the i-bit in the condition code register and sets the irqe enable bit in the irq control/status register so that the irq external interrupt is enabled. all other registers, including the other bits in the tcsr, and memory remain unaltered. all input/output lines remain unchanged. the mcu can be brought out of the stop mode by an irq external interrupt, irq2 external interrupt or a usb coming out from suspend mode interrupt (bus activity detection) or an externally generated reset, usb reset or an lvr reset. when exiting the stop mode the internal oscillator will resume after a 128 or 4064 internal processor clock cycle oscillator stabilization delay. 6.2 wait mode wait mode is entered by executing the wait instruction. this places the mcu in a low-power mode, which consumes more power than the stop mode. in the wait mode the internal processor clock is halted, suspending all processor and internal bus activity. execution of the wait instruction automatically clears the i-bit in the condition code register and sets the irqe enable bit in the irq control/ status register so that the irq external interrupt is enabled. all other registers, memory, and input/output lines remain in their previous states. the wait mode may be exited when an external irq, irq2, usb, timer1 or mft interrupt, an lvr reset, usb reset or an external reset occurs. 6.3 data-retention mode the data-retention mode is only available if the low voltage reset function (mask option) is not enabled. in the data retention mode, the mcu retains ram contents and cpu register con- tents at v dd voltages as low as 2.0vdc. the data retention feature allows the mcu to remain in a low power consumption state during which it retains data, but the cpu cannot execute instructions. the reset pin must be held low during data-retention mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola low power modes mc68HC05JB4 6-4 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 input/output ports motorola rev 2 7-1 section 7 input/output ports in normal operating mode there are 19 usable bidirectional i/o lines arranged as one 8-bit i/o port (port-a), one 5-bit i/o port (port-b), and one 6-bit i/o port (port c). the individual bits in these ports are programmable as either inputs or outputs under software control by the data direction registers (ddrs). each pin on port-a and port-b has individual internal pull-up resistor (50k w typi- cal) which can be enabled by software. in addition, port pins pa6, pa7, and all port-b pins have built in slow falling edge transition feature. this software select- able feature helps to eliminate emi noise. other functions such as high current drive, interrupt, are available on some port pins via mask option. 7.1 slow falling-edge output driver when enabled, the slow falling-edge output drive feature has a slow falling edge (drops from 5.0v to 2.2v in 167ns typically, with 50pf load) followed by a fast tran- sition to vss. the fast transition duration is depending on the strength of the output driver de?ed for each port. figure 7-1. slow falling-edge output driver 50pf 5.0v 165ns 330ns 2.2v output driver 0v f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola input/output ports mc68HC05JB4 7-2 rev 2 7.2 port-a port-a is an 8-bit bi-directional port. the port-a data register is at $0000 and the data direction register (ddra) is at $0004. reset does not affect the data regis- ters, but clears the data direction registers, thereby returning the port pins to inputs. writing a ? to a ddr bit sets the corresponding port bit to output mode. each pin in port-a has an internal pull-up resistor (50k w typical) which can be individually enabled by writing a ? to the corresponding bit in the port-a pull-up control register at location $0010. pa0 to pa4 have built-in schmitt triggered input to improve noise immunity. pa5 to pa7 port pins each has built in high current drive (10ma sink typical) for direct led drive. in addition, pa6 and pa7 each has optional 25ma drive which can be enabled by mask option. to minimize eme (electro-magnetic emission) noise, pa6 and pa7 has slow output transition which can be enabled by writing a ? to bit-7 of the port-b data direction register at location $0005. pa0 to pa3 and pa4 can be used to generate irq and irq2 interrupts respec- tively. pa0 to pa3 and pa4 cannot generate interrupts via irq and irq2 if these port pins are con?ured as output pins. if the pull-up device is enabled and the port pin is con?ured as output, the output port becomes an open-drain output with 50k w pull-up. note enabling or disabling the slow edge function on pa6 and pa7 does not change the pin con?uration. reading from an output pin will return the content of the data register. 7.2.1 port-a data register port-a purx port-a ddrx pin configuration 0 0 input 0 1 output push/pull 1 0 input with 50k pull-up 1 1 open-drain output with 50k pull-up bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pta r pa7 pa6 pa5 pa4 pa3 pa2 pa1 pa0 $0000 w reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 input/output ports motorola rev 2 7-3 7.2.2 port-a data direction register 7.2.3 port-a pull-up control register 7.3 port-b port-b is a 5-bit bi-directional port. the port-b data register is at $0001 and the data direction register (ddrb) is at $0005. reset does not affect the data regis- ters, but clears the data direction registers, thereby returning the port pins to inputs. writing a ?ne to a ddr bit sets the corresponding port bit to output mode. each pin in port-b has an internal pull-up resistor (50k w typical) which can be individually enabled by writing a ? to the corresponding bit in the port-b pull-up control register at location $0011. all port-b pins have built in slow output edge transition driver which can be enabled by writing a ? to bit-6 of port-b data direction register at location $0005. when pb0 is con?ured as an input, it also serves as the input capture pin for the 16-bit timer. when con?ured as output, the input to the input capture will be per- manently tied ?ow and no input capture can be generated. pb0 has built-in schmitt triggered input to improve noise immunity. pb3 and pb4 also serve as extra adc inputs, ad4 and ad5. when a port pin is selected as adc input and the adon bit is set to ?? the pin will be con?ured as input pin and its pull-up will be disabled automatically regardless of the status of the ddr-bit. the value of the ddr-bit will not be affected. if the pull-up device is enabled and the port pin is con?ured as output, the output port becomes an open-drain output with 50k w pull-up. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ddra r ddra7 ddra6 ddra5 ddra4 ddra3 ddra2 ddra1 ddra0 $0004 w reset: 00000000 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pura r $0010 w pura7 pura6 pura5 pura4 pura3 pura2 pura1 pura0 reset: 00000000 port-b purx port-b ddrx pin configuration 0 0 input 0 1 output push/pull 1 0 input with 50k pull-up 1 1 open-drain output with 50k pull-up f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola input/output ports mc68HC05JB4 7-4 rev 2 note enabling or disabling the slow edge function does not change the pin con?uration. reading from an output pin will return the content of the data register. 7.3.1 port-b data register 7.3.2 port-b data direction register slowea 1 = enable slow falling-edge output transition feature on pa6 and pa7. 0 = disable slow falling-edge output transition feature on pa6 and pa7. sloweb 1 = enable slow falling-edge output transition feature on pb0 to pb4. 0 = disable slow falling-edge output transition feature on pb0 to pb4. 7.3.3 port-b pull-up control register 7.4 port-c port-c is a 6-bit bi-directional port. the port-c data register is at $0002 and the data direction register (ddrc) is at $0006. reset does not affect the data regis- ters, but clears the data direction registers, thereby returning the port pins to inputs. writing a ?ne to a ddr bit sets the corresponding port bit to output mode. when the adon-bit is set, pc4 and pc5 are used as dedicated adc reference input, reference high (vrh) and reference low (vrl) respectively. and pc0 to pc3 can be used as adc inputs ad0 to ad3 when the appropriate channel is bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ptb r 0 0 0 pb4 pb3 pb2 pb1 pb0 $0001 w reset: 00000000 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ddrb r slowea sloweb 0 ddrb4 ddrb3 ddrb2 ddrb1 ddrb0 $0005 w reset: 00000000 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 purb r $0011 w purb4 purb3 purb2 purb1 purb0 reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 input/output ports motorola rev 2 7-5 selected. when a port pin is selected as adc input and the adon bit is set to ?? the pin will be con?ured as input pin automatically regardless of the status of the ddr-bit. the value of the ddr-bit will not be affected. note reading from an output pin will return the content of the data register. 7.4.1 port-c data register 7.4.2 port-c data direction register port-c ddrx pin configuration 0 input 1 output push/pull bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ptc r 0 0 pc5 pc4 pc3 pc2 pc1 pc0 $0002 w reset: 00000000 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ddrc r 0 0 ddrc5 ddrc4 ddrc3 ddrc2 ddrc1 ddrc0 $0006 w reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola input/output ports mc68HC05JB4 7-6 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 multi-function timer motorola rev 2 8-1 section 8 multi-function timer the multi-function timer module is a 15-stage ripple counter with timer over flow (tof), real time interrupt (rti), and cop watchdog function. figure 8-1. multi-function timer block diagram rti select circuit overflow circuit detect 88 f op ? 2 ? 10 internal timer clock (ntf1) tof rtif tofe rtie rt1 rt0 rtifr tofr timer control & status register ($08) timer counter register ($09) interrupt circuit cop watchdog resetable timer (?) 7-bit counter mcu internal bus to cpu interrupt ? 14 ? 15 ? 17 ? 16 ? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola multi-function timer mc68HC05JB4 8-2 rev 2 8.1 overview as shown in figure 8-1 , the timer is driven by the timer clock, ntf1, divided by four. ntf1 has the same phase and frequency as the processor bus clock, ph2, but continues to run in wait mode. the ntf1 drives an 8-bit ripple counter. the value of this 8-bit ripple counter can be read by the cpu at any time by accessing the timer counter register (tcnt) at address $09. a timer over?w function is implemented on the last stage of this 8-bit counter, giving a possible interrupt rate of f op 1024. the last stage of the 8-bit counter also drives a further 7-bit counter. the ?al four stages is used by the rti circuit, giving possible rti rates of f op ? 14 , 2 15 , 2 16 or 2 17 , selected by rt1 and rt0 (see table 8-1 ). the rti rate selector bits, and the rti and tof enable bits and ?gs are located in the timer control and status register at location $08. the power-on cycle clears the entire counter chain and begins clocking the counter. after 128 or 4064 cycles, the power-on reset circuit is released which again clears the counter chain and allows the device to come out of reset. at this point, if reset is not asserted, the timer will start counting up from zero and nor- mal device operation will begin. if reset is asserted at any time during operation the counter chain will be cleared. 8.2 computer operating properly (cop) watchdog the cop watchdog is enabled by a mask option. the cop watchdog timer function is implemented by using the output of the rti circuit and further dividing it by eight. the minimum cop reset rates are listed in table 8-1 . if the cop circuit times out, an internal reset is generated and the nor- mal reset vector is fetched. preventing a cop time-out is done by writing a ? to bit-0 of address $1ff0. when the cop is cleared, only the ?al divide by eight stage (output of the rti) is cleared. table 8-1. rti and cop rates at f op =3.0mhz bus frequency, f bus =f op =3.0 mhz rt1 rt0 divide ratio rti rate cop reset period (rti x 8) 00 2 14 5.46ms 43.68ms 01 2 15 10.92ms 87.36ms 10 2 16 21.85ms 174.8ms 11 2 17 43.69ms 349.52ms f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 multi-function timer motorola rev 2 8-3 8.3 mft registers 8.3.1 timer counter register (tcnt) $09 the timer counter register is a read-only register which contains the current value of the 8-bit ripple counter at the beginning of the timer chain. this counter is clocked at f op 4 and can be used for various functions including a software input capture. extended time periods can be attained using the tof function to incre- ment a temporary ram storage location thereby simulating a 16-bit (or more) counter. the value of each bit of the tcnt is shown in figure 8-2 . this register is cleared by reset. figure 8-2. timer counter register 8.3.2 timer control/status register (tcsr) $08 the tcsr contains the timer interrupt ?g bits, the timer interrupt enable bits, and the real time interrupt rate select bits. bit 2 and bit 3 are write-only bits which will read as logical zeros. figure 8-3 shows the value of each bit in the tcsr follow- ing reset. figure 8-3. timer control/status register (tcsr) tof - timer over?w flag the tof is a read-only ?g bit. 1 = set when the 8-bit ripple counter rolls over from $ff to $00. a timer interrupt request will be generated if tofe is also set. 0 = reset by writing a logical one to the tof acknowledge bit, tofr. writing to the tof ?g bit has no effect on its value. this bit is cleared by reset. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcnt r tmr7 tmr6 tmr5 tmr4 tmr3 tmr2 tmr1 tmr0 $0009 w reset: 00000000 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcsr r tof rtif tofe rtie 00 rt1 rt0 $0008 w tofr rtifr reset: 00000011 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola multi-function timer mc68HC05JB4 8-4 rev 2 rtif - real time interrupt flag the rtif is a read-only ?g bit. 1 = set when the output of the chosen (1 of 4 selections) real time interrupt stage goes active. a timer interrupt request will be generated if rtie is also set. 0 = reset by writing a logical one to the rtif acknowledge bit, rtifr. writing to the rtif ?g bit has no effect on its value. this bit is cleared by reset. tofe - timer over?w enable the tofe is an enable bit that allows generation of a timer interrupt upon over?w of the timer counter register. 1 = when set, the timer interrupt is generated when the tof ?g bit is set. 0 = when cleared, no timer interrupt caused by tof bit set will be generated. this bit is cleared by reset. rtie - real time interrupt enable the rtie is an enable bit that allows generation of a timer interrupt by the rtif bit. 1 = when set, the timer interrupt is generated when the rtif ?g bit is set. 0 = when cleared, no timer interrupt caused by rtif bit set will be generated. this bit is cleared by reset. tofr - timer over?w acknowledge the tofr is an acknowledge bit that resets the tof ?g bit. this bit is unaf- fected by reset. reading the tofr will always return a logical zero. 1 = clears the tof ?g bit. 0 = does not clear the tof ?g bit. rtifr - real time interrupt acknowledge the rtifr is an acknowledge bit that resets the rtif ?g bit. this bit is unaf- fected by reset. reading the rtifr will always return a logical zero. 1 = clears the rtif ?g bit. 0 = does not clear the rtif ?g bit. 8.4 operation during stop mode when stop is exited by an external interrupt or an lvr reset or an external reset , the internal oscillator will resume, followed by a 128 or 4064 internal pro- cessor oscillator stabilization delay. 8.5 cop consideration during stop mode in stop mode, the clock to the watchdog timer is stopped and is therefore impossible to generate cop reset when in stop mode. the cop function will resume 128 or 4064 cycles after exiting from stop. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 16-bit timer motorola rev 2 9-1 section 9 16-bit timer this 16-bit programmable timer (timer1) has an input capture function and an output compare function. figure 9-1 shows a block diagram of the 16-bit pro- grammable timer. figure 9-1. programmable timer block diagram iedg icie ocie toie tmrh ($0018) tmrl ($0019) 16-bit counter ? 4 internal (f osc ? 2) timer control register timer request overflow (tof) reset clock interrupt acrh ($001a) acrl ($001b) 16-bit comparator ocrh ($0016) ocrl ($0017) icap1 edge select & detect icf ocf tof timer status register iedg icf ocf $0012 $0013 internal data bus logic icrh ($0014) icrl ($0015) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola 16-bit timer mc68HC05JB4 9-2 rev 2 the basis of the 16-bit timer is a 16-bit free-running counter which increases in count with each internal bus clock cycle. the counter is the timing reference for the input capture and output compare functions. the input capture and output compare functions provide a means to latch the times at which external events occur, to measure input waveforms, and to generate output waveforms and timing delays. software can read the value in the 16-bit free-running counter at any time without affect the counter sequence. because of the 16-bit timer architecture, the i/o registers for the input capture and output compare functions are pairs of 8-bit registers. each register pair contains the high and low byte of that function. generally, accessing the low byte of a spe- ci? timer function allows full control of that function; however, an access of the high byte inhibits that speci? timer function until the low byte is also accessed. because the counter is 16 bits long and preceded by a ?ed divide-by-four pres- caler, the counter rolls over every 262,144 internal clock cycles. timer resolution with a 4mhz crystal oscillator is 2 microsecond/count. the interrupt capability, the input capture edge, and the output compare state are controlled by the timer control register (tcr) located at $0012 and the status of the interrupt ?gs can be read from the timer status register (tsr) located at $0013. 9.1 timer registers (tmrh, tmrl) the functional block diagram of the 16-bit free-running timer counter and timer registers is shown in figure 9-2 . the timer registers include a transparent buffer latch on the lsb of the 16-bit timer counter. figure 9-2. programmable timer counter block diagram toie tmrh ($0018) tmr lsb 16-bit counter ? 4 internal (f osc ? 2) timer control reg. timer request overflow (tof) reset clock interrupt tmrl ($0019) tof timer status reg. $0012 $0013 internal ($fffc) data read tmrh read tmrl read latch bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 16-bit timer motorola rev 2 9-3 the timer registers (tmrh, tmrl) shown in figure 9-3 are read-only locations which contain the current high and low bytes of the 16-bit free-running counter. writing to the timer registers has no effect. reset of the device presets the timer counter to $fffc. the tmrl latch is a transparent read of the lsb until the a read of the tmrh takes place. a read of the tmrh latches the lsb into the tmrl location until the tmrl is again read. the latched value remains ?ed even if multiple reads of the tmrh take place before the next read of the tmrl. therefore, when reading the msb of the timer at tmrh the lsb of the timer at tmrl must also be read to complete the read sequence. during power-on-reset (por), the counter is initialized to $fffc and begins counting after the oscillator start-up delay. because the counter is sixteen bits and preceded by a ?ed divide-by-four prescaler, the value in the counter repeats every 262, 144 internal bus clock cycles (524, 288 oscillator cycles). when the free-running counter rolls over from $ffff to $0000, the timer over?w ?g bit (tof) is set in the tsr. when the tof is set, it can generate an interrupt if the timer over?w interrupt enable bit (toie) is also set in the tcr. the tof ?g bit can only be reset by reading the tmrl after reading the tsr. other than clearing any possible tof ?gs, reading the tmrh and tmrl in any order or any number of times does not have any effect on the 16-bit free-running counter. note to prevent interrupts from occurring between readings of the tmrh and tmrl, set the i bit in the condition code register (ccr) before reading tmrh and clear the i bit after reading tmrl. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tmrh r tmrh7 tmrh6 tmrh5 tmrh4 tmrh3 tmrh2 tmrh1 tmrh0 $0018 w reset: 11111111 tmrl r tmrl7 tmrl6 tmrl5 tmrl4 tmrl3 tmrl2 tmrl1 tmrl0 $0019 w reset: 11111100 figure 9-3. programmable timer counter registers (tmrh, tmrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola 16-bit timer mc68HC05JB4 9-4 rev 2 9.2 alternate counter registers (acrh, acrl) the functional block diagram of the 16-bit free-running timer counter and alternate counter registers is shown in figure 9-4 . the alternate counter registers behave the same as the timer registers, except that any reads of the alternate counter will not have any effect on the tof ?g bit and timer interrupts. the alternate counter registers include a transparent buffer latch on the lsb of the 16-bit timer counter. figure 9-4. alternate counter block diagram the alternate counter registers (acrh, acrl) shown in figure 9-5 are read-only locations which contain the current high and low bytes of the 16-bit free-running counter. writing to the alternate counter registers has no effect. reset of the device presets the timer counter to $fffc. the acrl latch is a transparent read of the lsb until the a read of the acrh takes place. a read of the acrh latches the lsb into the acrl location until the acrl is again read. the latched value remains ?ed even if multiple reads of the acrh take place before the next read of the acrl. therefore, when reading the msb of the timer at acrh the lsb of the timer at acrl must also be read to complete the read sequence. during power-on-reset (por), the counter is initialized to $fffc and begins counting after the oscillator start-up delay. because the counter is sixteen bits and preceded by a ?ed divide-by-four prescaler, the value in the counter repeats every 262,144 internal bus clock cycles (524,288 oscillator cycles). reading the acrh and acrl in any order or any number of times does not have any effect on the 16-bit free-running counter or the tof ?g bit. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 acrh r acrh7 acrh6 acrh5 acrh4 acrh3 acrh2 acrh1 acrh0 $001a w reset: 11111111 acrl r acrl7 acrl6 acrl5 acrl4 acrl3 acrl2 acrl1 acrl0 $001b w reset: 11111100 figure 9-5. alternate counter registers (acrh, acrl) acrh ($001a) tmr lsb 16-bit counter ? 4 internal (f osc ? 2) reset clock acrl ($001b) internal ($fffc) data read acrh read acrl read latch bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 16-bit timer motorola rev 2 9-5 note to prevent interrupts from occurring between readings of the acrh and acrl, set the i bit in the condition code register (ccr) before reading acrh and clear the i bit after reading acrl. 9.3 input capture registers the input capture function is a technique whereby an external signal (connected to pb0/icap1 pin) is used to trigger the 16-bit timer counter. in this way it is possi- ble to relate the timing of an external signal to the internal counter value, and hence to elapsed time. when the input capture circuitry detects an active edge on the icap1 pin, it latches the contents of the free-running timer counter registers into the input cap- ture registers as shown in figure 9-6 . latching values into the input capture registers at successive edges of the same polarity measures the period of the selected input signal. latching the counter val- ues at successive edges of opposite polarity measures the pulse width of the sig- nal. figure 9-6. timer input capture block diagram the input capture registers are made up of two 8-bit read-only registers (icrh, icrl) as shown in figure 9-7 . the input capture edge detector contains a schmitt trigger to improve noise immunity. the edge that triggers the counter transfer is de?ed by the input edge bit (iedg) in the tcr. reset does not affect the con- tents of the input capture registers. icie icrh ($0014) 16-bit counter ? 4 internal (f osc ? 2) timer control reg. timer request input capture (icf) reset clock interrupt icrl ($0015) icf timer status reg. $0012 $0013 internal ($fffc) data read icrh read icrl latch bus iedg edge select & detect logic iedg pb0/icap1 internal data bus f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola 16-bit timer mc68HC05JB4 9-6 rev 2 the result obtained by an input capture will be one count higher than the value of the free-running timer counter preceding the external transition. this delay is required for internal synchronization. resolution is affected by the prescaler, allowing the free-running timer counter to increment once every four internal clock cycles (eight oscillator clock cycles). reading the icrh inhibits further captures until the icrl is also read. reading the icrl after reading the timer status register (tsr) clears the icf ?g bit. does not inhibit transfer of the free-running counter. there is no con?ct between read- ing the icrl and transfers from the free-running timer counters. the input capture registers always contain the free-running timer counter value which corresponds to the most recent input capture. note to prevent interrupts from occurring between readings of the icrh and icrl, set the i bit in the condition code register (ccr) before reading icrh and clear the i bit after reading icrl. 9.4 output compare registers the output compare function is a means of generating an interrupt when the 16- bit timer counter reaches a selected value as shown in figure 9-8 . software writes the selected value into the output compare registers. on every fourth inter- nal clock cycle (every eight oscillator clock cycle) the output compare circuitry compares the value of the free-running timer counter to the value written in the output compare registers. when a match occurs, the output compare interrupt ?g, ocf is set. a timer interrupt request to the cpu is generated if the output compare interrupt enable is set, i.e. ocie=1. software can use the output compare register to measure time periods, to gener- ate timing delays, or to generate a pulse of speci? duration or a pulse train of speci? frequency and duty cycle. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 icrh r icrh7 icrh6 icrh5 icrh4 icrh3 icrh2 icrh1 icrh0 $0014 w reset: uuuuuuuu icrl r icrl7 icrl6 icrl5 icrl4 icrl3 icrl2 icrl1 icrl0 $0015 w reset: uuuuuuuu u = unaffected by reset figure 9-7. input capture registers (icrh, icrl) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 16-bit timer motorola rev 2 9-7 writing to the ocrh before writing to the ocrl inhibits timer compares until the ocrl is written. reading or writing to the ocrl after reading the tsr will clear the output compare ?g bit (ocf). figure 9-8. timer output compare block diagram to prevent ocf from being set between the time it is read and the time the output compare registers are updated, use the following procedure: 1. disable interrupts by setting the i bit in the condition code register. 2. write to the ocrh. compares are now inhibited until ocrl is written. 3. read the tsr to arm the ocf for clearing. 4. enable the output compare registers by writing to the ocrl. this also clears the ocf ?g bit in the tsr. 5. enable interrupts by clearing the i bit in the condition code register. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ocrh r ocrh7 ocrh6 ocrh5 ocrh4 ocrh3 ocrh2 ocrh1 ocrh0 $0016 w reset: uuuuuuuu ocrl r ocrl7 ocrl6 ocrl5 ocrl4 ocrl3 ocrl2 ocrl1 ocrl0 $0017 w reset: uuuuuuuu u = unaffected by reset figure 9-9. output compare registers (ocrh, ocrl) ocie ocrh ($0016) 16-bit counter ? 4 internal (f osc ? 2) timer control reg. timer request output compare reset clock interrupt ocrl ($0017) ocf timer status reg. $0012 $0013 internal ($fffc) data r/w ocrh r/w ocrl bus 16-bit comparator (ocf) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola 16-bit timer mc68HC05JB4 9-8 rev 2 a software example of this procedure is shown below. 9.5 timer control register (tcr) the timer control register is shown in figure 9-10 performs the following func- tions: enables input capture interrupts enables output compare interrupts enables timer over?w interrupts control the active edge polarity of the icap1 signal on pin pb0/icap1 reset clears all the bits in the tcr with the exception of the iedg bit which is unaffected. icie - input capture interrupt enable this read/write bit enables interrupts caused by an active signal on the pb0/ icap1 pin. reset clears the icie bit. 1 = input capture interrupts enabled. 0 = input capture interrupts disabled. ocie - output compare interrupt enable this read/write bit enables interrupts caused by a successful compare between the timer counter and the output compare registers. reset clears the ocie bit. 1 = output compare interrupts enabled. 0 = output compare interrupts disabled. toie - timer overflow interrupt enable this read/write bit enables interrupts caused by a timer over?w. reset clears the toie bit. 1 = timer over?w interrupts enabled. 0 = timer over?w interrupts disabled. 9b ... ... b7 b6 bf ... ... 9a 16 13 17 sei ... ... sta lda stx ... ... cli ocrh tsr ocrl disable interrupts ..... ..... inhibit output compare arm ocf flag for clearing ready for next compare, ocf cleared ..... ..... enable interrupts bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tcr r icie ocie toie 000 iedg 0 $0012 w reset: 000000 unaffected 0 figure 9-10. timer control register (tcr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 16-bit timer motorola rev 2 9-9 iedg - input capture edge select the state of this read/write bit determines whether a positive or negative transi- tion on the icap1 pin triggers a transfer of the contents of the timer register to the input capture register. reset has no effect on the iedg bit. 1 = positive edge (low to high transition) triggers input capture. 0 = negative edge (high to low transition) triggers input capture. 9.6 timer status register (tsr) the timer status register (tsr) shown in figure 9-11 contains ?gs for the follow- ing events: an active signal on the pb0/icap1 pin, transferring the contents of the timer registers to the input capture registers. a match between the 16-bit counter and the output compare registers an over?w of the timer registers from $ffff to $0000. writing to any of the bits in the tsr has no effect. reset does not change the state of any of the ?g bits in the tsr. icf - input capture flag the icf bit is automatically set when an edge of the selected polarity occurs on the pb0/icap1 pin. clear the icf bit by reading the timer status register with the icf set, and then reading the low byte (icrl, $0015) of the input capture registers. reset has no effect on icf. ocf - output compare flag the ocf bit is automatically set when the value of the timer registers matches the contents of the output compare registers. clear the ocf bit by reading the timer status register with the ocf set, and then accessing the low byte (ocrl, $0017) of the output compare registers. reset has no effect on ocf. tof - timer overflow flag the tof bit is automatically set when the 16-bit timer counter rolls over from $ffff to $0000. clear the tof bit by reading the timer status register with the tof set, and then accessing the low byte (tmrl, $0019) of the timer registers. reset has no effect on tof. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 tsrricfocftof00000 $0013 w reset: u u u 00000 u = unaffected by reset figure 9-11. timer status registers (tsr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola 16-bit timer mc68HC05JB4 9-10 rev 2 9.7 timer operation during wait mode during wait mode the 16-bit timer continues to operate normally and may gener- ate an interrupt to trigger the mcu out of the wait mode. 9.8 timer operation during stop mode when the mcu enters the stop mode the free-running counter stops counting (the internal processor clock is stopped). it remains at that particular count value until the stop mode is exited by applying a low signal to the irq pin, at which time the counter resumes from its stopped value as if nothing had happened. if stop mode is exited via an external reset (logic low applied to the reset pin) the counter is forced to $fffc. if a valid input capture edge occurs at the pb0/tcap pin during the stop mode the input capture detect circuitry will be armed. this action does not set any ?gs or ?ake up the mcu, but when the mcu does ?ake up there will be an active input capture ?g (and data) from the ?st valid edge. if the stop mode is exited by an external reset, no input capture ?g or data will be present even if a valid input capture edge was detected during the stop mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-1 section 10 universal serial bus module this usb module is designed for usb application in ls products. with minimized software effort, it can fully comply with usb ls device speci?ation. see usb speci?ation version 1.0 for the detail description of usb. 10.1 features integrated 3.3 volt regulator with 3.3v output pin integrated usb transceiver supporting low speed functions usb data control logic packet decoding/generation crc generation and checking nrzi encoding/decoding bit-stuf?g usb reset support control endpoint 0 and interrupt endpoints 1 and 2 two 8-byte transmit buffers one 8-byte receive buffer suspend and resume operations remote wake-up support usb generated interrupts transaction interrupt driven resume interrupt end of packet interrupt stall, nak, and ack handshake generation f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-2 rev 2 10.2 overview this section provides an overview of the universal serial bus (usb) module in the mc68HC05JB4. this usb module is designed to serve as a low-speed (ls) usb device per the universal serial bus speci?ation rev 1.0. three types of usb data transfers are supported: control, interrupt, and bulk (transmit only). endpoint 0 functions as a receive/transmit control endpoint. endpoints 1 and 2 can function as interrupt or bulk, but only in the transmit direction. a block diagram of the usb module is shown figure 10-1 . the usb module manages communications between the host and the usb function. the module is partitioned into four functional blocks. these blocks consist of a 3.3 volt regulator, a dual function transceiver, the usb control logic, and the endpoint registers. the blocks are further detailed in section 10.4 . figure 10-1. usb block diagram 10.2.1 usb protocol figure 10-2 shows the various transaction types supported by the mc68HC05JB4 usb module. the transactions are portrayed as error free. the effect of errors in the data ?w are discussed later. d+ d usb control logic transceiver rcv vpin vmin vpout vmout regulator 3.3v out cpu bus usb registers usb upstream port f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-3 figure 10-2. supported transaction types per endpoint each usb transaction is comprised of a series of packets. the mc68HC05JB4 usb module supports the packet types shown in figure 10-3 . token packets are generated by the usb host and decoded by the usb device. data and handshake packets are both decoded and generated by the usb device depending on the type of transaction. setup in out data0/1 data0 data1 ack data1 out ack out data0 ack ack data0/1 endpoint 0 transactions: control write control read no-data control endpoints 1 & 2 transactions: interrupt bulk transmit in ack key: unrelated bus traffic host generated device generated ack setup out in data0/1 data0 data1 ack data1 in ack in data0 ack ack ack setup in data0 data1 ack ack data0/1 in ack f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-4 rev 2 figure 10-3. supported usb packet types the following sections will give some detail on each segment used to form a complete usb transaction. 10.2.1.1 sync pattern the nrzi (see section 10.4.4.1 ) bit pattern shown in figure 10-4 is used as a synchronization pattern and is pre?ed to each packet. this pattern is equivalent to a data pattern of seven 0s followed by a 1 (0x80). figure 10-4. sync pattern the start of a packet (sop) is signaled by the originating port by driving the d+ and d?lines from the idle state (also referred to as the ? state) to the opposite logic level (also referred to as the ? state). this switch in levels represents the ?st bit of the sync ?ld. figure 10-5 shows the data signaling and voltage levels for the start of packet and the sync pattern. token packet: in out sync pid pid addr endp crc5 eop setup data packet: data 0 sync pid pid data crc5 eop data 1 0 - 8 bytes handshake packet: ack nak sync pid pid eop stall sync pattern pid0 pid1 idle nrzi data encoding f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-5 figure 10-5. sop, sync signaling and voltage levels 10.2.1.2 packet identi?r field the packet identi?r ?ld is an eight bit number comprised of the four bit packet identi?ation (pid) and its complement. the ?ld follows the sync pattern and determines the direction and type of transaction on the bus. table 10-1 shows the pid values for the supported packet types. table 10-1. supported packet identi?rs 10.2.1.3 address field (addr) the address ?ld is a seven bit number that is used to select a particular usb device. this ?ld is compared to the lower seven bits of the uaddr register to determine if a given transaction is targeting the mc68HC05JB4 usb device. pid value pid type %1001 in token %0001 out token %1101 setup token %0011 data0 packet %1011 data1 packet %0010 ack handshake %1010 nak handshake %1110 stall handshake end of sync first bit of packet sop bus idle v oh (min) v se (max) v se (min) v ol (min) v ss f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-6 rev 2 10.2.1.4 endpoint field (endp) the endpoint ?ld is a four bit number that is used to select a particular endpoint within a usb device. for the mc68HC05JB4, this will be a binary number between zero and two inclusive. any other value will cause the transaction to be ignored. 10.2.1.5 cyclic redundancy check (crc) cyclic redundancy checks are used to verify the address and data stream of a usb transaction. this ?ld is ?e bits wide for token packets and sixteen bits wide for data packets. crcs are generated in the transmitter and sent on the usb data lines after both the endpoint ?ld and the data ?ld. figure 10-6 shows how the ?e bit crc value is calculated from the data stream and veri?d for the address and endpoint ?lds of a token packet. figure 10-7 shows how the sixteen bit crc value is calculated and either transmitted or veri?d for the data packet of a given transaction. figure 10-6. crc block diagram for address and endpoint fields 0010 1 0110 0 0 5 5 5 5 next bit data stream - update every bit time. - reset to ones at sop equal? good crc bad crc 5 y n expected residual: generator polynomial: mux 1 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-7 figure 10-7. crc block diagram for data packets 10.2.1.6 end of packet (eop) the single-ended 0 (se0) state is used to signal an end of packet (eop). the single-ended 0 state is indicated by both d+ and d?being below 0.8 v. eop will be signaled by driving d+ and d?to the single-ended 0 state for two bit times followed by driving the lines to the idle state for one bit time. the transition from the single-ended 0 to the idle state de?es the end of the packet. the idle state is asserted for one bit time and then both the d+ and d?output drivers are placed in their high-impedance state. the bus termination resistors hold the bus in the idle state. figure 10-8 shows the data signaling and voltage levels for an end of packet transaction. mux 0 16 16 16 16 1 0 next bit input / output - update every bit time - reset to ones at sop equal? good crc bad crc 16 y n expected residual: generator polynomial: data stream output data stream crc16 transmitted msb first after final data byte. transmit receive 000 00 10 0 00 00010 1 00000 10000 00110 1 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-8 rev 2 figure 10-8. eop transaction voltage levels the width of the se0 in the eop is about two bit times. the eop width is measured with the same capacitive load used for maximum rise and fall times and is measured at the same level as the differential signal crossover points of the data lines. figure 10-9. eop width timing 10.2.2 reset signaling a reset is signaled on the bus by the presence of an extended se0 at the usb data pins of a device. the reset signaling is speci?d to be present for a minimum of 10 ms. an active device (powered and not in the suspend state) seeing a single-ended zero on its usb data inputs for more than 2.5 m s may treat that signal as a reset, but must have interpreted the signaling as a reset within 5.5 m s. for a low speed device, an se0 condition between 4 and 8 low speed bit times represents a valid usb reset. a usb sourced reset will hold the mc68HC05JB4 in reset for the duration of the reset on the usb bus. the rstf bit in the usb interrupt register 0 (uir0) will be set after the internal reset is removed (see section 10.5.2 for more detail). after a reset is removed, the device will be in the attached, but not yet addressed or con?ured state (refer to section 9.1 of the usb speci?ation). the device must be able to accept a device address via a set_address command (refer to section 9.4 of the usb speci?ation) no later than 10 ms after the reset is removed. bus driven to last bit of bus idle eop strobe packet idle state bus floats v oh (min) v se (max) v se (min) v ol (min) v ss eop width t period differential data lines data crossover level f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-9 reset can wake a device from the suspended mode. a device may take up to 10ms to wake up from the suspended state. 10.2.3 suspend the mc68HC05JB4 supports suspend mode for low power. suspend mode should be entered when the usb data lines are in the idle state for more than 3.0 ms. entry into suspend mode is controlled by the suspnd bit in the usb interrupt register. any low speed bus activity should keep the device out of the suspend state. low speed devices are kept awake by periodic low speed eop signals from the host. this is referred to as low speed keep alive (refer to section 11.2.5.1 of the usb speci?ation). firmware should monitor the eopf ?g and enter suspend mode by setting the suspnd bit if an eop is not detected for 3 ms. per the usb speci?ation, the mc68HC05JB4 is required to draw less than 500 m a from the v dd supply when in the suspend state. this includes the current supplied by the voltage regulator to the 15 k w to ground termination resistors placed at the host end of the usb bus. this low current requirement means that ?mware is responsible for entering stop mode once the usb module has been placed in the suspend state. 10.2.4 resume after suspend the mc68HC05JB4 can be activated from the suspend state by normal bus activity, a usb reset signal, or by a forced resume driven from the mc68HC05JB4. 10.2.4.1 host initiated resume the host signals resume by initiating resume signalling (? state) for at least 20 ms followed by a standard low speed eop signal. this 20 ms ensures that all devices in the usb network are awakened. after resuming the bus, the host must begin sending bus traf? within 3 ms to prevent the device from re-entering suspend mode. 10.2.4.2 usb reset signalling reset can wake a device from the suspended mode. a device may take up to 10 ms to wake up from the suspended state. 10.2.4.3 remote wake-up the mc68HC05JB4 also supports the remote wake-up feature. the ?mware has the ability to exit suspend mode by signaling a resume state to the upstream host or hub. a non-idle state (? state) on the usb data lines is accomplished by asserting the fresum bit in the ucr1 register. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-10 rev 2 when using the remote wake-up capability, the ?mware must wait for at least 5 ms after the bus is in the idle state before sending the remote wake-up resume signaling. this allows the upstream devices to get into their suspend state and prepare for propagating resume signaling. the fresum bit should be asserted to cause the resume state on the usb data lines for at least 10ms, but not more than 15ms. note that the resume signalling is controlled by the fresum bit and meeting the timing speci?ations is dependent on the ?mware. when fresum is cleared by ?mware, the data lines will return to their high impedance state. refer to section 10.5.5 for more information about how the force resume (fresum) bit can be used to initiate the remote wake-up feature. 10.2.5 low speed device externally, low speed devices are con?ured by the position of a pull-up resistor on the usb d?pin of the mc68HC05JB4. low speed devices are terminated as shown in figure 10-10 with the pull-up on the d?line. figure 10-10. external low speed device con?uration for low speed transmissions, the transmitters eop width must be between 1.25 m s and 1.50 m s. these ranges include timing variations due to differential buffer delay and rise/fall time mismatches and to noise and other random effects. a low speed receiver must accept a 670ns wide se0 followed by a j transition as a valid eop. an se0 narrower than 330ns or an se0 not followed by a j transition must be rejected as an eop. an eop between 330ns and 670ns may be rejected or accepted as above. any se0 that is 2.5 m s or wider is automatically a reset. 10.3 clock requirements the low speed data rate is nominally 1.5 mbs. the oscxclk signal driven by the oscillator circuits is the clock source for the usb module and requires that a 6 mhz oscillator circuit be connected to the osc1 and osc2 pins. the permitted frequency tolerance for low speed functions is approximately 1.5% (15000 ppm). this tolerance includes inaccuracies from all sources: initial frequency accuracy, crystal capacitive loading, supply voltage on the oscillator, temperature, and aging. the jitter in the low speed data rate must be less than 10 ns. this tolerance allows the use of resonators in low cost, low speed devices. 10.4 hardware description the usb module as previously shown in figure 10-1 contains four functional blocks: a 3.3 volt regulator, a ls usb transceiver, the usb control logic, and the 68HC05JB4 1.5k w d+ d 3.3v regulator out usb low speed cable f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-11 usb registers. the following will detail the function of the regulator, transceiver and control logic. see section 10.5 for the register discussion. 10.4.1 voltage regulator the usb data lines are required by the usb speci?ation to have a maximum output voltage between 2.8v and 3.6v. the data lines are also required to have an external 1.5k w pullup resistor connected between a data line and a voltage source between 3.0v and 3.6v. since the power provided by the usb cable is speci?d to be between 4.4v and 5.0v, an on-chip regulator is used to drop the voltage to the appropriate level for sourcing the usb transceiver and external pullup resistor. an output pin driven by the regulator voltage is provided to source the 1.5k w external resistor. figure 10-11 shows the worst case electrical connection for the voltage regulator. figure 10-11. regulator electrical connections 10.4.2 usb transceiver the usb transceiver provides the physical interface to the usb d+ and d?data lines. the transceiver is composed of two parts: an output drive circuit and a differential receiver. 10.4.2.1 output driver characteristics the usb transceiver uses a differential output driver to drive the usb data signal onto the usb cable. the static output swing of the driver in its low state is below the v ol of 0.3 v with a 1.5 k w load to 3.6 v and in its high state is above the v oh of 2.8 v with a 15 k w load to ground. the output swings between the differential high and low state are well balanced to minimize signal skew. slew rate control on the driver is used to minimize the radiated noise and cross talk. the drivers outputs support three-state operation to achieve bi-directional half duplex operation. the driver can tolerate a voltage on the signal pins of ?.5 v to 3.8 v ls transceiver 3.3v r2 r2 r1 r1 = 1.5k w 5% r2 = 15k w 5% regulator usb data lines host or hub usb cable 4.4v f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-12 rev 2 with respect to local ground reference without damage. 10.4.2.2 low speed (1.5 mbs) driver characteristics the rise and fall time of the signals on this cable are greater than 75 ns to keep rfi emissions under fcc class b limits, and less than 300 ns to limit timing delays and signaling skews and distortions. the driver reaches the speci?d static signal levels with smooth rise and fall times, and minimal re?ctions and ringing when driving the cable. this driver is used only on network segments between low speed devices and the ports to which they are connected. figure 10-12. low speed driver signal waveforms 10.4.3 receiver characteristics usb data transmission is done with differential signals. a differential input receiver is used to accept the usb data signal. a differential 1 on the bus is represented by d+ being at least 200 mv more positive than d?as seen at the receiver, and a differential 0 is represented by d?being at least 200 mv more positive than d+ as seen at the receiver. the signal cross over point must be between 1.3v and 2.0v. the receiver features an input sensitivity of 200 mv when both differential data inputs are in the range of 0.8 v to 2.5 v with respect to the local ground reference. this is called the common mode input voltage range. proper data reception is also achieved when the differential data lines are outside the common mode range, as shown in figure 10-13 . the receiver can tolerate static input voltages between ?.5v to 3.8 v with respect to its local ground reference without damage. in addition to the differential receiver, there is a single-ended receiver (schmitt trigger) for each of the two data lines. one bit time (1.5 mb/s) signal pins pass output spec levels with minimal reflections and ringing v se (min) v se (max) v ss f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-13 figure 10-13. differential input sensitivity over entire common mode range 10.4.3.1 receiver data jitter the data receivers for all types of devices must be able to properly decode the differential data in the presence of jitter. the more of the bit cell that any data edge can occupy and still be decoded, the more reliable the data transfer will be. data receivers are required to decode differential data transitions that occur in a window plus and minus a nominal quarter bit cell from the nominal (centered) data edge position. jitter will be caused by the delay mismatches and by mismatches in the source and destination data rates (frequencies). the receive data jitter budget for low speed is given in the electrical section of the this speci?ation. the speci?ation includes the consecutive (next) and paired transition values for each source of jitter. 10.4.3.2 data source jitter the source of data can have some variation (jitter) in the timing of edges of the data transmitted. the time between any set of data transitions is n x t period jitter time, where ? is the number of bits between the transitions and t period is de?ed as the actual period of the data rate. the data jitter is measured with the same capacitive load used for maximum rise and fall times and is measured at the crossover points of the data lines as shown in figure 10-14 . common mode input voltage (volts) 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 1.0 0.8 0.6 0.4 0.2 minimum differential sensitivity (volts) 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-14 rev 2 figure 10-14. data jitter for low speed transmissions, the jitter time for any consecutive differential data transitions must be within 25 ns and within 10 ns for any set of paired differential data transitions. these jitter numbers include timing variations due to differential buffer delay, rise/fall time mismatches, internal clock source jitter, and to noise and other random effects. 10.4.3.3 data signal rise and fall time the output rise time and fall time are measured between 10% and 90% of the signal. edge transition time for the rising and falling edges of low speed signals is 75 ns (minimum) into a capacitive load (c l ) of 50 pf and 300 ns (maximum) into a capacitive load of 350 pf. the rising and falling edges should be smooth transitional (monotonic) when driving the cable to avoid excessive emi. figure 10-15. data signal rise and fall time 10.4.4 usb control logic the usb control logic manages data movement between the cpu and the transceiver. the control logic handles both transmit and receive operations on the usb. it contains the logic used to manipulate the transceiver and the endpoint registers. the logic contains byte count buffers for transmit operations that load the active transmit endpoints byte count and use this to determine the number of bytes to transfer. this same buffer is used for receive transactions to count the number of bytes received and, upon the end of the transaction, transfer that number to the receive endpoints byte count register. consecutive transitions t period differential data lines crossover points paired transitions t r differential data lines t f rise time fall time 10% 90% 90% 10% low speed: 75 ns at c l = 50 pf, 300 ns at c l = 350 pf c l c l f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-15 when transmitting, the control logic handles parallel to serial conversion, crc generation, nrzi encoding, and bit stuf?g. when receiving, the control logic handles sync detection, packet identi?ation, end of packet detection, bit (un)stuf?g, nrzi decoding, crc validation, and serial to parallel conversion. errors detected by the control logic include bad crc, time-out while waiting for eop, and bit stuf?g violations. 10.4.4.1 data encoding/decoding the usb employs nrzi data encoding when transmitting packets. in nrzi encoding, a 1 is represented by no change in level and a 0 is represented by a change in level. figure 10-16 shows a data stream and the nrzi equivalent and figure 10-17 is a ?w diagram for nrzi. the high level represents the j state on the data lines in this and subsequent ?ures showing nrzi encoding. a string of zeros causes the nrzi data to toggle each bit time. a string of ones causes long periods with no transitions in the data. figure 10-16. nrzi data encoding figure 10-17. flow diagram for nrzi idle data idle nrzi 0110 0 000 00 0 11 1 11 power up no packet transmission idle begin packet fetch the data bit no yes no data transition transition is package transfer done? no yes data transmission is data bit = 0? f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-16 rev 2 10.4.4.2 bit stuf?g in order to ensure adequate signal transitions, bit stuf?g is employed by the transmitting device when sending a packet on the usb (see figure 10-18 and figure 10-19 ). a 0 is inserted after every six consecutive 1s in the data stream before the data is nrzi encoded to force a transition in the nrzi data stream. this gives the receiver logic a data transition at least once every seven bit times to guarantee the data and clock lock. the receiver must decode the nrzi data, recognize the stuffed bits, and discard them. bit stuf?g is enabled beginning with the sync pattern and throughout the entire transmission. the data ?ne that ends the sync pattern is counted as the ?st one in a sequence. bit stuf?g is always enforced, without exception. if required by the bit stuf?g rules, a zero bit will be inserted even if it is the last bit before the end-of-packet (eop) signal. figure 10-18. bit stuf?g idle nrzi encoded data bit stuffed data raw data stuffed bit sync pattern packet data packet data sync pattern packet data sync pattern six ones f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-17 figure 10-19. flow diagram for bit stuf?g 10.5 i/o register description the usb endpoint registers are comprised of a set of control/status registers and twenty-four data registers that provide storage for the buffering of data between the usb and the cpu. these registers are shown in table 10-2 . table 10-2. register summary power up no packet transmission idle no yes is package transfer done? no yes reset the bit counter to 0 insert a zero bit counter = 6? increment the counter = 0 = 1 bit value? get next bit reset bit counter to 0 begin packet transmission f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-18 rev 2 10.5.1 usb address register (uaddr) register name bit 7 6 5 4 3 2 1 bit 0 addr usb control register 2 (ucr2) 0 tx1st 0 enable2 enable1 stall2 stall1 $0037 tx1str usb address register (uaddr) usben uadd6 uadd5 uadd4 uadd3 uadd2 uadd1 uadd0 $0038 usb interrupt register 0 (uir0) txd0f rxd0f rstf suspnd txd0ie rxd0ie 00 $0039 txd0fr rxd0fr usb interrupt register 1 (uir1) txd1f eopf resumf 0 txd1ie eopie 00 $003a resumfr txd1fr eopfr usb control register 0 (ucr0) t0seq stall0 tx0e rx0e tp0siz3 tp0siz2 tp0siz1 tp0siz0 $003b usb control register 1 (ucr1) t1seq endadd tx1e fresum tp1siz3 tp1siz2 tp1siz1 tp1siz0 $003c usb status register (usr) rseq setup 0 0 rpsiz3 rpsiz2 rpsiz1 rpsiz0 $003d usb endpoint 0 data register 0 (ue0d0) ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 $0020 ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 usb endpoint 0 data register 7 (ue0d7) ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 $0027 ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 usb endpoint 1/2 data register 0 (ue1d0) $0028 ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 usb endpoint 1/2 data register 7 (ue1d7) $002f ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 = unimplemented bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 uaddr r usben uadd6 uadd5 uadd4 uadd3 uadd2 uadd1 uadd0 $0038 w reset: 00000000 figure 10-20. usb address register (uaddr) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-19 usben ?usb module enable this read/write bit enables and disables the usb module and the usb pins. when usben is clear, the usb module will not respond to any tokens. reset clears this bit. 1 = usb function enabled 0 = usb function disabled uadd6-uadd0 ?usb function address these bits specify the usb address of the device. reset clears these bits. 10.5.2 usb interrupt register 0 (uir0) txd0f ?endpoint 0 data transmit flag this read only bit is set after the data stored in endpoint 0 transmit buffers has been sent and an ack handshake packet from the host is received. once the next set of data is ready in the transmit buffers, software must clear this ?g by writing a logic 1 to the txd0fr bit. to enable the next data packet transmis- sion, tx0e must also be set. if txd0f bit is not cleared, a nak handshake will be returned in the next in transaction. reset clears this bit. writing a logic 0 to txd0f has no effect. 1 = transmit on endpoint 0 has occurred 0 = transmit on endpoint 0 has not occurred rxd0f ?endpoint 0 data receive flag this read only bit is set after the usb module has received a data packet and responded with an ack handshake packet. software must clear this ?g by writing a logic 1 to the rxd0fr bit after all of the received data has been read. software must also set rx0e bit to one to enable the next data packet recep- tion. if rxd0f bit is not cleared, a nak handshake will be returned in the next out transaction. reset clears this bit. writing a logic 0 to rxd0f has no effect. 1 = receive on endpoint 0 has occurred 0 = receive on endpoint 0 has not occurred rstf ?usb reset flag this read only bit is set when a valid reset signal state is detected on the d+ and d?lines. this reset detection will also generate an internal reset signal to reset the cpu and other peripherals including the usb module. this bit is cleared by a por reset. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 uir0 r txd0f rxd0f rstf suspnd txd0ie rxd0ie 00 $0039 w txd0fr rxd0fr reset: 00000000 = unimplemented figure 10-21. usb interrupt register 0 (uir0) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-20 rev 2 suspnd ?usb suspend flag to save power, this read/write bit should be set by the software if a 3ms con- stant idle state is detected on usb bus. setting this bit stops the clock to the usb and causes the usb module to enter suspend mode. unnecessary ana- log circuitry will be powered down. software must clear this bit after the resume ?g (resumf) is set while this resume interrupt ?g is serviced. txd0ie ?endpoint 0 transmit interrupt enable this read/write bit enables the transmit endpoint 0 to generate a usb interrupt when the txd0f bit becomes set. 1 = usb interrupts enabled for transmit endpoint 0 0 = usb interrupts disabled for transmit endpoint 0 rxd0ie ?endpoint 0 receive interrupt enable this read/write bit enables the transmit endpoint 0 to generate a usb interrupt when the rxd0f bit becomes set. 1 = usb interrupts enabled for receive endpoint 0 0 = usb interrupts disabled for receive endpoint 0 txd0fr ?endpoint 0 transmit flag reset writing a logic 1 to this write only bit will clear the txd0f bit if it is set.writing a logic 0 to txd0fr has no effect. reset clears this bit. rxd0fr ?endpoint 0 receive flag reset writing a logic 1 to this write only bit will clear the rxd0f bit if it is set.writing a logic 0 to rxd0fr has no effect. reset clears this bit. 10.5.3 usb interrupt register 1 (uir1) txd1f ?endpoint 1/endpoint 2 data transmit flag this read only bit is shared by endpoint 1 and endpoint 2. it is set after the data stored in the shared endpoint 1/endpoint 2 transmit buffer has been sent and an ack handshake packet from the host is received. once the next set of data is ready in the transmit buffers, software must clear this ?g by writing a logic 1 to the txd1fr bit. to enable the next data packet transmission, tx1e must also be set. if txd1f bit is not cleared, a nak handshake will be returned in the next in transaction. reset clears this bit. writing a logic 0 to txd1f has no effect. 1 = transmit on endpoint 1 or endpoint 2 has occurred 0 = transmit on endpoint 1 or endpoint 2 has not occurred bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 uir1 r txd1f eopf resumf 0 txd1ie eopie 00 $003a w resumfr txd1fr eopfr reset: 00000000 = unimplemented figure 10-22. usb interrupt register 1(uir1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-21 eopf ?end of packet detect flag this read only bit is set when a valid end-of-packet sequence is detected on the d+ and d?lines. software must clear this ?g by writing a logic 1 to the eopfr bit. reset clears this bit. writing a logic 0 to eopf has no effect. 1 = end-of-packet sequence has been detected 0 = end-of-packet sequence has not been detected resumf ?resume flag this read only bit is set when usb bus activity is detected while the suspnd bit is set. software must clear this ?g by writing a logic 1 to the resumfr bit. reset clears this bit. writing a logic 0 to resumf has no effect. 1 = usb bus activity has been detected 0 = no usb bus activity has been detected resumfr ?resume flag reset writing a logic 1 to this write only bit will clear the resumf bit if it is set. writ- ing a logic 0 to resumfr has no effect. reset clears this bit. txd1ie ?endpoint 1/endpoint 2 transmit interrupt enable this read/write bit enables the usb to generate an interrupt when the shared transmit endpoint 1/endpoint 2 interrupt ?g (txd1f) bit becomes set. reset clears this bit. 1 = usb interrupts enabled for transmit endpoints 1 and 2 0 = usb interrupts disabled for transmit endpoints 1 and 2 eopie ?end of packet detect interrupt enable this read/write bit enables the usb to generate an interrupt when the eopf bit becomes set. reset clears this bit. 1 = usb interrupts enabled for transmit endpoints 1 and 2 0 = usb interrupts disabled for transmit endpoint 1 and 2 txd1fr ?endpoint 1/endpoint 2 transmit flag reset writing a logic 1 to this write only bit will clear the txd1f bit if it is set. writing a logic 0 to txd1fr has no effect. reset clears this bit. eopfr ?end of packet flag reset writing a logic 1 to this write only bit will clear the eopf bit if it is set. writing a logic 0 to the eopfr has no effect. reset clears this bit. 10.5.4 usb control register 0 (ucr0) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ucr0 r t0seq stall0 tx0e rx0e tp0siz3 tp0siz2 tp0siz1 tp0siz0 $003b w reset: 00000000 figure 10-23. usb control register 0 (ucr0) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-22 rev 2 t0seq ?endpoint 0 transmit sequence bit this read/write bit determines which type of data packet (data0 or data1) will be sent during the next in transaction. toggling of this bit must be controlled by software. reset clears this bit. 1 = data1 token active for next endpoint 0 transmit 0 = data0 token active for next endpoint 0 transmit stall0 ?endpoint 0 force stall bit this read/write bit causes endpoint 0 to return a stall handshake when polled by either an in or out token by the usb host controller. the usb hard- ware clears this bit when a setup token is received. reset clears this bit. 1 = send stall handshake 0 = default tx0e ?endpoint 0 transmit enable this read/write bit enables a transmit to occur when the usb host controller sends an in token to endpoint 0. software should set this bit when data is ready to be transmitted. it must be cleared by software when no more endpoint 0 data needs to be transmitted. if this bit is 0 or the txd0f is set, the usb will respond with a nak handshake to any endpoint 0 in tokens. reset clears this bit. 1 = data is ready to be sent. 0 = data is not ready. respond with nak. rx0e ?endpoint 0 receive enable this read/write bit enables a receive to occur when the usb host controller sends an out token to endpoint 0. software should set this bit when data is ready to be received. it must be cleared by software when data cannot be received. if this bit is 0 or the rxd0f is set, the usb will respond with a nak handshake to any endpoint 0 out tokens. reset clears this bit. 1 = data is ready to be received. 0 = not ready for data. respond with nak. tp0siz3-tp0siz0 ?endpoint 0 transmit data packet size these read/write bits store the number of transmit data bytes for the next in token request for endpoint 0. these bits are cleared by reset. 10.5.5 usb control register 1 (ucr1) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ucr1 r t1seq endadd tx1e fresum tp1sz3 tp1siz2 tp1siz1 tp1siz0 $003c w reset: 00000000 figure 10-24. usb control register 1 (ucr1) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-23 t1seq ?endpoint1/endpoint 2 transmit sequence bit this read/write bit determines which type of data packet (data0 or data1) will be sent during the next in transaction directed to endpoint 1 or endpoint 2. toggling of this bit must be controlled by software. reset clears this bit. 1 = data1 token active for next endpoint 1/endpoint 2 transmit 0 = data0 token active for next endpoint 1/endpoint 2 transmit endadd ?endpoint address select this read/write bit speci?s whether the data inside the registers ue1d0-ue1d7 are used for endpoint 1 or endpoint 2. if all the conditions for a successful endpoint 2 usb response to a hosts in token are satis?d (txd1f=0, tx1e=1, stall2=0, and enable2=1) except that the endadd bit is con?ured for endpoint 1, the usb responds with a nak handshake packet. 1 = the data buffers are used for endpoint 2 0 = the data buffers are used for endpoint 1 tx1e ?endpoint 1/endpoint 2 transmit enable this read/write bit enables a transmit to occur when the usb host controller sends an in token to endpoint 1 or endpoint 2. the appropriate endpoint enable bit, enable1 or enable2 bit in the ucr2 register, should also be set. software should set the tx1e bit when data is ready to be transmitted. it must be cleared by software when no more data needs to be transmitted. if this bit is 0 or the txd1f is set, the usb will respond with a nak handshake to any endpoint 1 or endpoint 2 directed in tokens. reset clears this bit. 1 = data is ready to be sent. 0 = data is not ready. respond with nak. fresum ?force resume this read/write bit forces a resume state (? or non-idle state) onto the usb data lines to initiate a remote wake-up. software should control the timing of the forced resume to be between 10ms and 15 ms. setting this bit will not cause the resumf bit to set. 1 = force data lines to ? state 0 = default tp1siz3-tp1siz0 ?endpoint 1/endpoint 2 transmit data packet size these read/write bits store the number of transmit data bytes for the next in token request for endpoint 1 or endpoint 2. these bits are cleared by reset. 10.5.6 usb control register 2 (ucr2) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ucr2 r 0 tx1st 0 enable2 enable1 stall2 stall1 $0037 w tx1str reset : - - 0 - 0000 = unimplemented figure 10-25. usb control register 2 (ucr2) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-24 rev 2 tx1str ?clear transmit first flag writing a logic 1 to this write-only bit will clear the tx1st bit if it is set. writing a logic 0 to the tx1str has no effect. reset clears this bit. tx1st ?transmit first flag this read-only bit is set if the endpoint 0 data transmit flag (txd0f) is set when the usb control logic is setting the endpoint 0 data receive flag (rxd0f). that is, this bit will be set if an endpoint 0 transmit flag is still set at the end of an endpoint 0 reception. this bit lets the ?mware know that the endpoint 0 transmission happened before the endpoint 0 reception. reset clears this bit. 1 = in transaction occurred before setup/out. 0 = in transaction occurred after setup/out. enable2 ?endpoint 2 enable this read/write bit enables endpoint 2 and allows the usb to respond to in packets addressed to endpoint 2. reset clears this bit. 1 = endpoint 2 is enabled and can respond to an in token. 0 = endpoint 2 is disabled enable1 ?endpoint 1 enable this read/write bit enables endpoint 1 and allows the usb to respond to in packets addressed to endpoint 1. reset clears this bit. 1 = endpoint 1 is enabled and can respond to an in token. 0 = endpoint 1 is disabled stall2 ?endpoint 2 force stall bit this read/write bit causes endpoint 2 to return a stall handshake when polled by either an in or out token by the usb host controller. reset clears this bit. 1 = send stall handshake. 0 = default stall1 ?endpoint 1 force stall bit this read/write bit causes endpoint 1 to return a stall handshake when polled by either an in or out token by the usb host controller. reset clears this bit. 1 = send stall handshake 0 = default f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-25 10.5.7 usb status register (usr) rseq ?endpoint 0 receive sequence bit this read only bit indicates the type of data packet last received for endpoint 0 (data0 or data1). 1 = data1 token received in last endpoint 0 receive 0 = data0 token received in last endpoint 0 receive setup ?setup token detect bit this read only bit indicates that a valid setup token has been received. 1 = last token received for endpoint 0 was a setup token 0 = last token received for endpoint 0 was not a setup token rpsiz3-rpsiz0 ?endpoint 0 receive data packet size these read only bits store the number of data bytes received for the last out or setup transaction for endpoint 0. these bits are not affected by reset. 10.5.8 usb endpoint 0 data registers (ue0d0-ue0d7) ue0rd7 - ue0rd0 ?endpoint 0 receive data buffer these read only bits are serially loaded with out token or setup token data received over the usbs d+ and d?pins. ue0td7 - ue0td0 ?endpoint 0 transmit data buffer these write only buffers are loaded by software with data to be sent on the usb bus on the next in token directed at endpoint 0. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 usr r rseq setup 0 0 rpsiz3 rpsiz2 rpsiz1 rpsiz0 $003d w reset: uuuuuuuu = unimplemented figure 10-26. usb status register (usr) bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ue0d0 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 $0020 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 to :::::::: :::::::: ue0d7 r ue0rd7 ue0rd6 ue0rd5 ue0rd4 ue0rd3 ue0rd2 ue0rd1 ue0rd0 $0027 w ue0td7 ue0td6 ue0td5 ue0td4 ue0td3 ue0td2 ue0td1 ue0td0 reset: xxxxxxxx figure 10-27. usb endpoint 0 data register (ue0d0-ue0d7) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-26 rev 2 10.5.9 usb endpoint 1/endpoint 2 data registers (ue1d0-ue1d7) ue1td7 - ue1td0 ?endpoint 1/ endpoint 2 transmit data buffer these write only buffers are loaded by software with data to be sent on the usb bus on the next in token directed at endpoint 1 or endpoint 2. these buff- ers are shared by endpoints 1 and 2 and depend on proper con?uration of the endadd bit. 10.6 usb interrupts the usb module is capable of generating interrupts and causing the cpu to execute the usb interrupt service routine. there are three types of usb interrupts: end of transaction interrupts signify a completed transaction (receive or transmit) resume interrupts signify that the usb bus is reactivated after having been suspended end of packet interrupts signify that a low speed end of packet signal was detected all usb interrupts share the same interrupt vector. firmware is responsible for determining which interrupt is active. 10.6.1 usb end of transaction interrupt there are three possible end of transaction interrupts: endpoint 0 receive, endpoint 0 transmit, and a shared endpoint 1 or endpoint 2 transmit. end of transaction interrupts occur as detailed in the following sections. 10.6.1.1 receive control endpoint 0 for a control out transaction directed at endpoint 0, the usb module will generate an interrupt by setting the rxd0f ?g in the uir0 register. the conditions necessary for the interrupt to occur are shown in the ?wchart of figure 10-29 . setup transactions cannot be stalled by the usb function. a setup received by a control endpoint will clear the stall0 bit if it is set. the conditions for receiving bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 ue1d0 r $0028 w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 to :::::::: :::::::: ue1d7 r $002f w ue1td7 ue1td6 ue1td5 ue1td4 ue1td3 ue1td2 ue1td1 ue1td0 reset: xxxxxxxx figure 10-28. usb endpoint 1/endpoint2 data registers (ue1d0-ue1d7) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-27 a setup interrupt are shown in figure 10-30 . 10.6.1.2 transmit control endpoint 0 for a control in transaction directed at endpoint 0, the usb module will generate an interrupt by setting the txd0f ?g in the uir0 register. the conditions necessary for the interrupt to occur are shown in the ?wchart of figure 10-31 . 10.6.1.3 transmit endpoint 1 and transmit endpoint 2 transmit endpoints 1 & 2 share their interrupt ?g. for an in transaction directed at endpoint 1 or 2, the usb module will generate an interrupt by setting the txd1f ?g in the uir1 register. the conditions necessary for the interrupt to occur are shown in the ?wchart of figure 10-32 . 10.6.2 resume interrupt the usb module will generate a usb interrupt if low speed bus activity is detected after entering the suspend state. a transition of the usb data lines to the non-idle state (? state) while in the suspend mode will set the resumf ?g in the uir1 register. there is no interrupt enable bit for this interrupt source and an interrupt will be executed if the i bit in the ccr is cleared. a resume interrupt can only occur while the mc68HC05JB4 is in the suspend mode. 10.6.3 end of packet interrupt the usb module can generate a usb interrupt upon detection of an end of packet signal (a single ended 0) for low speed devices. upon detection of an se0 sequence, the usb module sets the eopf bit and will generate an interrupt if the eopie bit in the uir1 register is set. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-28 rev 2 figure 10-29. out token data flow for receive endpoint 0 valid out token received for endpoint 0 endpoint 0 receive enabled? (usben = 1) endpoint 0 receive ready to receive? (rx0e = 1) && (rxd0f = 0) error free data packet? no response from usb function send nak handshake ignore transaction no response from usb function set rxd0f to 1 receive control endpoint interrupt enabled? (rxd0ie = 1) no interrupt valid transaction interrupt generated endpoint 0 receive not stalled? (stall0 = 0) send stall handshake accept data valid data token received for endpoint 0? no response from usb function time-out n n n n n n y y y y y y y set/clear rseq bit f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-29 figure 10-30. setup token data flow for receive endpoint 0 valid setup token received for endpoint 0 endpoint 0 receive enabled? (usben = 1) error free data packet? no response from usb function ignore transaction no response from usb function set rxd0f to 1 receive control endpoint interrupt enabled? (rxd0ie = 1) no interrupt valid transaction interrupt generated accept data set setup to 1 n n n y y y y y y y stall0 = 0? n clear stall0 bit endpoint 0 receive ready to receive? (rx0e = 1) && (rxd0f = 0) n y set/clear rseq bit no response from usb function f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-30 rev 2 figure 10-31. in token data flow for transmit endpoint 0 transmit endpoint enabled? (usben = 1) transmit endpoint ready to transfer? (tx0e = 1) && (txd0f = 0) no response from usb function send nak handshake ack received and no set txd0f to 1 transmit endpoint interrupt enabled? (txd0ie = 1) no interrupt valid transaction interrupt generated transmit endpoint not stalled by firmware? (stall0 = 0) send stall handshake send data data pid set by t0seq valid in token received for endpoint 0 n y n n y y y no response from usb function n y time-out condition occur? y n f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 universal serial bus module motorola rev 2 10-31 figure 10-32. in token data flow for transmit endpoint 1/2 transmit endpoint enabled? (usben = 1) transmit endpoint ready to transfer? (tx1e = 1) && (txd1f = 0) & no response from usb function send nak handshake set txd1f to 1 transmit endpoint interrupt enabled? (txd1ie = 1) no interrupt valid transaction interrupt generated transmit endpoint not stalled by firmware? (stall1 & endp1) + (stall2 & endp2) send stall handshake send data data pid set by t1seq valid in token received for endpoints 1 or 2 n y n n y y y ack received and no time-out condition occurs? no response from usb function n y ((endp2 & endadd) + (endp1 & endadd )) endp1 is endpoint 1 directed traffic endp2 is endpoint 2 directed traffic note: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola universal serial bus module mc68HC05JB4 10-32 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 analog to digital converter motorola rev 2 11-1 section 11 analog to digital converter the analog to digital converter system consists of a single 8-bit successive approximation converter and an 16-channel analog multiplexer. six of the chan- nels are available for analog inputs, four channels are dedicated to internal test functions, and the remaining six channels are unused. there is one 8-bit adc data register ($0f) and one 8-bit adc status and control register ($0e). the ref- erence supply, v rl and v rh for the converter uses two input pins (shared with port pins pc4 and pc5) instead of the power supply lines, because drops caused by loading in the power supply lines would degrade the accuracy of the analog to dig- ital conversion. an internal rc oscillator is available if the bus speed is low enough to degrade the adc accuracy. an adon bit allows the adc to be switched off to reduce power consumption, which is particularly useful in the wait mode. figure 11-1. adc converter block diagram ch3 ch2 ch1 ch0 coco adrc adon 8-bit capacitive dac with sample and hold successive approximation register and control result adc status and control register ($0e) analog mux (channel assignment) adc data register ($0f) vrh vrl ad0 v rh (v rh +v rl )/2 v rl ad1 ad2 ad3 (v rh +v rl )/4 8 ad4 ad5 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola analog to digital converter mc68HC05JB4 11-2 rev 2 11.1 adc operation as shown in figure 11-1 , the adc consists of an analog multiplexer, an 8-bit digi- tal to analog capacitor array, a comparator and a successive approximation regis- ter (sar). there are ten options that can be selected by the multiplexer; the ad0 to ad5 input pins, v rh , v rl , (v rh +v rl )/4, or (v rh +v rl )/2. selection is done via the chx bits in the adc status and control register. ad0 to ad5 are input points for adc conversion operations; the others are reference points which can be used for test purposes. the converter uses v rh and v rl as reference voltages. an input volt- age equal to or greater than v rh converts to $ff. an input voltage equal to or less than v rl , but greater than v ss , converts to $00. maximum and minimum ratings must not be exceeded. each analog input source should use v rh as the supply voltage and should be referenced to v rl for the ratiometric conversions. to main- tain full accuracy of the adc, the following should be noted: 1. v rh should be equal to or less than v cc ; 2. v rl should be equal to or greater than v ss but less than maximum speci?ations; and 3. v rh ? rl should be equal to or greater than 4 volts. the adc reference inputs (v rh and v rl ) are applied to a precision internal digital to analog converter. control logic drives this d/a converter and the analog output is successively compared with the selected analog input sampled at the beginning of the conversion. the conversion is monotonic with no missing codes. the result of each successive comparison is stored in the successive approxima- tion register (sar) and, when the conversion is complete, the contents of the sar are transferred to the read-only adc data register ($0f), and the conversion complete ?g, coco, is set in the adc status and control register ($0e). note any write to the adc status and control register will abort the current conversion, reset the conversion complete ?g (coco) and a new conversion starts on the selected channel. at power-on or external reset, both the adrc and adon bits are cleared, thus the adc is disabled. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 analog to digital converter motorola rev 2 11-3 11.2 adc status and control register (adscr) the adscr is a read/write register containing status and control bits for the adc. figure 11-2. a/d status and control register coco ?conversion complete 1 = an adc conversion has completed; adc data register ($0f) contains valid conversion result. 0 = adc conversion not completed. this read-only status bit is set when a conversion is completed, indicating that the adc data register contains a valid result. this coco bit is cleared either by a write to the adscr or a read of the adc data register. once the coco bit is cleared, a new conversion automatically starts. if the coco bit is not cleared, conversions are initiated every 32 cycles. in this continuous conver- sion mode the adc data register is refreshed with new data, every 32 cycles, and the coco bit remains set. adrc ?adc rc oscillator control 1 = adc uses rc oscillator as clock source. 0 = adc uses internal processor clock as clock source. the rc oscillator option must be used if the internal processor is running below 1mhz. a stabilization time of typically 1ms is required when switching to the rc oscillator option. adon ?adc on 1 = adc is switched on. 0 = adc is switched off. when the adc is turned from off to on, it requires a time t adon for the cur- rent sources to stabilize. during this time adc conversion results may be inac- curate. switching the adc off disables the internal charge pump and rc oscillator (if selected by adrc=1), and hence saving power. ch3:ch0 ?channel select bits these four bits selects one of ten adc channels for the conversion. channels 0 to 5 correspond to inputs ad0-ad5 on port pins pc0-pc3, pb3 and pb4 respectively. channels 12 and 13 are the adc reference inputs v rh and v rl , on port pins pc4 and pc5 respectively. channels 14 and 15 are used for inter- nal reference points. table 11-1 shows the signals selected by the channel select bits. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 adscr r coco adrc adon 0 ch3 ch2 ch1 ch0 $000e w reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola analog to digital converter mc68HC05JB4 11-4 rev 2 using a port pin as both an analog and digital input simultaneously is prohib- ited. when the adc is enabled (adon=1) and one of channels is selected, the corresponding port pin will appear as a logic zero when read from the port data register. note that the pull-up on a port-b pin will be disabled automatically when that port pin is selected as the adc input and the adon bit is set to logic ?? 11.3 adc data register (addr) the addr stores the result of a valid adc conversion when the coco bits is set in adscr. figure 11-3. a/d data register table 11-1. a/d channel assignments ch3 ch2 ch1 ch0 channel signal 0000 0 ad0 (pc0) 0001 1 ad1 (pc1) 0010 2 ad2 (pc2) 0011 3 ad3 (pc3) 0100 4 ad4 (pb3) 0101 5 ad5 (pb4) 0110 6 not implemented 0111 7 not implemented 1000 8 not implemented 1001 9 not implemented 1010 10 not implemented 1011 11 not implemented 1100 12 vrh (pc4) 1101 13 vrl (pc5) 1110 14 (vrh+vrl)/4 1111 15 (vrh+vrl)/2 bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 addr r addr7 addr6 addr5 addr4 addr3 addr2 addr1 addr0 $000f w reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 analog to digital converter motorola rev 2 11-5 11.4 adc during low power modes the adc continues normal operation in wait mode. to reduce power consump- tion in wait mode, the adon and adrc bits in the adscr should be cleared if the adc is not used. if the adc is in use and the internal bus clock is above 1mhz, it is recommended that the adrc bit be cleared. in stop mode, the adc stops operation. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola analog to digital converter mc68HC05JB4 11-6 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 instruction set motorola rev 2 12-1 section 12 instruction set this section describes the addressing modes and instruction types. 12.1 addressing modes the cpu uses eight addressing modes for ?xibility in accessing data. the addressing modes de?e the manner in which the cpu ?ds the data required to execute an instruction. the eight addressing modes are the following: inherent immediate direct extended indexed, no offset indexed, 8-bit offset indexed, 16-bit offset relative 12.1.1 inherent inherent instructions are those that have no operand, such as return from interrupt (rti) and stop (stop). some of the inherent instructions act on data in the cpu registers, such as set carry ?g (sec) and increment accumulator (inca). inherent instructions require no memory address and are one byte long. 12.1.2 immediate immediate instructions are those that contain a value to be used in an operation with the value in the accumulator or index register. immediate instructions require no memory address and are two bytes long. the opcode is the ?st byte, and the immediate data value is the second byte. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola instruction set mc68HC05JB4 12-2 rev 2 12.1.3 direct direct instructions can access any of the ?st 256 memory addresses with two bytes. the ?st byte is the opcode, and the second is the low byte of the operand address. in direct addressing, the cpu automatically uses $00 as the high byte of the operand address. brset and brclr are three-byte instructions that use direct addressing to access the operand and relative addressing to specify a branch destination. 12.1.4 extended extended instructions use only three bytes to access any address in memory. the ?st byte is the opcode; the second and third bytes are the high and low bytes of the operand address. when using the motorola assembler, the programmer does not need to specify whether an instruction is direct or extended. the assembler automatically selects the shortest form of the instruction. 12.1.5 indexed, no offset indexed instructions with no offset are one-byte instructions that can access data with variable addresses within the ?st 256 memory locations. the index register contains the low byte of the conditional address of the operand. the cpu automatically uses $00 as the high byte, so these instructions can address locations $0000?00ff. indexed, no offset instructions are often used to move a pointer through a table or to hold the address of a frequently used ram or i/o location. 12.1.6 indexed, 8-bit offset indexed, 8-bit offset instructions are two-byte instructions that can access data with variable addresses within the ?st 511 memory locations. the cpu adds the unsigned byte in the index register to the unsigned byte following the opcode. the sum is the conditional address of the operand. these instructions can access locations $0000?01fe. indexed 8-bit offset instructions are useful for selecting the kth element in an n-element table. the table can begin anywhere within the ?st 256 memory locations and could extend as far as location 510 ($01fe). the k value is typically in the index register, and the address of the beginning of the table is in the byte following the opcode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 instruction set motorola rev 2 12-3 12.1.7 indexed, 16-bit offset indexed, 16-bit offset instructions are three-byte instructions that can access data with variable addresses at any location in memory. the cpu adds the unsigned byte in the index register to the two unsigned bytes following the opcode. the sum is the conditional address of the operand. the ?st byte after the opcode is the high byte of the 16-bit offset; the second byte is the low byte of the offset. these instructions can address any location in memory. indexed, 16-bit offset instructions are useful for selecting the kth element in an n-element table anywhere in memory. as with direct and extended addressing, the motorola assembler determines the shortest form of indexed addressing. 12.1.8 relative relative addressing is only for branch instructions. if the branch condition is true, the cpu ?ds the conditional branch destination by adding the signed byte following the opcode to the contents of the program counter. if the branch condition is not true, the cpu goes to the next instruction. the offset is a signed, twos complement byte that gives a branching range of ?28 to +127 bytes from the address of the next location after the branch instruction. when using the motorola assembler, the programmer does not need to calculate the offset, because the assembler determines the proper offset and veri?s that it is within the span of the branch. 12.1.9 instruction types the mcu instructions fall into the following ?e categories: register/memory instructions read-modify-write instructions jump/branch instructions bit manipulation instructions control instructions f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola instruction set mc68HC05JB4 12-4 rev 2 12.1.10 register/memory instructions most of these instructions use two operands. one operand is in either the accumulator or the index register. the cpu ?ds the other operand in memory. table 12-1 lists the register/memory instructions. table 12-1. register/memory instructions instruction mnemonic add memory byte and carry bit to accumulator adc add memory byte to accumulator add and memory byte with accumulator and bit test accumulator bit compare accumulator cmp compare index register with memory byte cpx exclusive or accumulator with memory byte eor load accumulator with memory byte lda load index register with memory byte ldx multiply mul or accumulator with memory byte ora subtract memory byte and carry bit from accumulator sbc store accumulator in memory sta store index register in memory stx subtract memory byte from accumulator sub f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 instruction set motorola rev 2 12-5 12.1.11 read-modify-write instructions these instructions read a memory location or a register, modify its contents, and write the modi?d value back to the memory location or to the register. the test for negative or zero instruction (tst) is an exception to the read-modify-write sequence because it does not write a replacement value. table 12-2 lists the read-modify-write instructions. 12.1.12 jump/branch instructions jump instructions allow the cpu to interrupt the normal sequence of the program counter. the unconditional jump instruction (jmp) and the jump to subroutine instruction (jsr) have no register operand. branch instructions allow the cpu to interrupt the normal sequence of the program counter when a test condition is met. if the test condition is not met, the branch is not performed. all branch instructions use relative addressing. bit test and branch instructions cause a branch based on the state of any readable bit in the ?st 256 memory locations. these three-byte instructions use a combination of direct addressing and relative addressing. the direct address of the byte to be tested is in the byte following the opcode. the third byte is the signed offset byte. the cpu ?ds the conditional branch destination by adding the table 12-2. read-modify-write instructions instruction mnemonic arithmetic shift left asl arithmetic shift right asr clear bit in memory bclr set bit in memory bset clear clr complement (one? complement) com decrement dec increment inc logical shift left lsl logical shift right lsr negate (two? complement) neg rotate left through carry bit rol rotate right through carry bit ror test for negative or zero tst f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola instruction set mc68HC05JB4 12-6 rev 2 third byte to the program counter if the speci?d bit tests true. the bit to be tested and its condition (set or clear) is part of the opcode. the span of branching is from ?28 to +127 from the address of the next location after the branch instruction. the cpu also transfers the tested bit to the carry/borrow bit of the condition code register. table 12-3 lists the jump and branch instructions. table 12-3. jump and branch instructions instruction mnemonic branch if carry bit clear bcc branch if carry bit set bcs branch if equal beq branch if half-carry bit clear bhcc branch if half-carry bit set bhcs branch if higher bhi branch if higher or same bhs branch if irq pin high bih branch if irq pin low bil branch if lower blo branch if lower or same bls branch if interrupt mask clear bmc branch if minus bmi branch if interrupt mask set bms branch if not equal bne branch if plus bpl branch always bra branch if bit clear brclr branch never brn branch if bit set brset branch to subroutine bsr unconditional jump jmp jump to subroutine jsr f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 instruction set motorola rev 2 12-7 12.1.13 bit manipulation instructions the cpu can set or clear any writable bit in the ?st 256 bytes of memory. port registers, port data direction registers, timer registers, and on-chip ram locations are in the ?st 256 bytes of memory. the cpu can also test and branch based on the state of any bit in any of the ?st 256 memory locations. bit manipulation instructions use direct addressing. table 12-4 lists these instructions. 12.1.14 control instructions these register reference instructions control cpu operation during program execution. control instructions, listed in table 12-5 , use inherent addressing. table 12-4. bit manipulation instructions instruction mnemonic clear bit bclr branch if bit clear brclr branch if bit set brset set bit bset table 12-5. control instructions instruction mnemonic clear carry bit clc clear interrupt mask cli no operation nop reset stack pointer rsp return from interrupt rti return from subroutine rts set carry bit sec set interrupt mask sei stop oscillator and enable irq pin stop software interrupt swi transfer accumulator to index register tax transfer index register to accumulator txa stop cpu clock and enable interrupts wait f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola instruction set mc68HC05JB4 12-8 rev 2 12.1.15 instruction set summary table 12-6 is an alphabetical list of all m68hc05 instructions and shows the effect of each instruction on the condition code register. table 12-6. instruction set summary source form operation description effect on ccr address mode opcode operand cycles h i nzc adc # opr adc opr adc opr adc opr ,x adc opr ,x adc ,x add with carry a ? (a) + (m) + (c) imm dir ext ix2 ix1 ix a9 b9 c9 d9 e9 f9 ii dd hh ll ee ff ff 2 3 4 5 4 3 add # opr add opr add opr add opr ,x add opr ,x add ,x add without carry a ? (a) + (m) imm dir ext ix2 ix1 ix ab bb cb db eb fb ii dd hh ll ee ff ff 2 3 4 5 4 3 and # opr and opr an d opr and opr ,x and opr ,x and ,x logical and a ? (a) (m) imm dir ext ix2 ix1 ix a4 b4 c4 d4 e4 f4 ii dd hh ll ee ff ff 2 3 4 5 4 3 asl opr asla aslx asl opr ,x asl ,x arithmetic shift left (same as lsl) 38 48 58 68 78 dd ff 5 3 3 6 5 asr opr asra asrx asr opr ,x asr ,x arithmetic shift right dir inh inh ix1 ix 37 47 57 67 77 dd ff 5 3 3 6 5 bcc rel branch if carry bit clear pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bclr n opr clear bit n mn ? 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 11 13 15 17 19 1b 1d 1f dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bcs rel branch if carry bit set (same as blo) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 beq rel branch if equal pc ? (pc) + 2 + rel ? z = 1 rel 27 rr 3 bhcc rel branch if half-carry bit clear pc ? (pc) + 2 + rel ? h = 0 rel 28 rr 3 c b0 b7 0 b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 instruction set motorola rev 2 12-9 bhcs rel branch if half-carry bit set pc ? (pc) + 2 + rel ? h = 1 rel 29 rr 3 bhi rel branch if higher pc ? (pc) + 2 + rel ? c z = 0 rel 22 rr 3 bhs rel branch if higher or same pc ? (pc) + 2 + rel ? c = 0 rel 24 rr 3 bih rel branch if irq pin high pc ? (pc) + 2 + rel ? irq = 1 rel 2f rr 3 bil rel branch if irq pin low pc ? (pc) + 2 + rel ? irq = 0 rel 2e rr 3 bit # opr bit opr bit opr bit opr ,x bit opr ,x bit ,x bit test accumulator with memory byte (a) (m) imm dir ext ix2 ix1 ix a5 b5 c5 d5 e5 f5 ii dd hh ll ee ff ff p 2 3 4 5 4 3 blo rel branch if lower (same as bcs) pc ? (pc) + 2 + rel ? c = 1 rel 25 rr 3 bls rel branch if lower or same pc ? (pc) + 2 + rel ? c z = 1 rel 23 rr 3 bmc rel branch if interrupt mask clear pc ? (pc) + 2 + rel ? i = 0 rel 2c rr 3 bmi rel branch if minus pc ? (pc) + 2 + rel ? n = 1 rel 2b rr 3 bms rel branch if interrupt mask set pc ? (pc) + 2 + rel ? i = 1 rel 2d rr 3 bne rel branch if not equal pc ? (pc) + 2 + rel ? z = 0 rel 26 rr 3 bpl rel branch if plus pc ? (pc) + 2 + rel ? n = 0 rel 2a rr 3 bra rel branch always pc ? (pc) + 2 + rel ? 1 = 1 rel 20 rr 3 brclr n opr rel branch if bit n clear pc ? (pc) + 2 + rel ? mn = 0 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 01 03 05 07 09 0b 0d 0f dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brset n opr rel branch if bit n set pc ? (pc) + 2 + rel ? mn = 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 00 02 04 06 08 0a 0c 0e dd rr dd rr dd rr dd rr dd rr dd rr dd rr dd rr 5 5 5 5 5 5 5 5 brn rel branch never pc ? (pc) + 2 + rel ? 1 = 0 rel 21 rr 3 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola instruction set mc68HC05JB4 12-10 rev 2 bset n opr set bit n mn ? 1 dir (b0) dir (b1) dir (b2) dir (b3) dir (b4) dir (b5) dir (b6) dir (b7) 10 12 14 16 18 1a 1c 1e dd dd dd dd dd dd dd dd 5 5 5 5 5 5 5 5 bsr rel branch to subroutine pc ? (pc) + 2; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1 pc ? (pc) + rel rel ad rr 6 clc clear carry bit c ? 0 0 inh 98 2 cli clear interrupt mask i ? 0 0 inh 9a 2 clr opr clra clrx clr opr ,x clr ,x clear byte m ? $00 a ? $00 x ? $00 m ? $00 m ? $00 0 1 dir inh inh ix1 ix 3f 4f 5f 6f 7f dd ff 5 3 3 6 5 cmp # opr cmp opr cmp opr cmp opr ,x cmp opr ,x cmp ,x compare accumulator with memory byte (a) ?(m) imm dir ext ix2 ix1 ix a1 b1 c1 d1 e1 f1 ii dd hh ll ee ff ff 2 3 4 5 4 3 com opr coma comx com opr ,x com ,x complement byte (one? complement) m ? ( ) = $ff ?(m) a ? ( ) = $ff ?(m) x ? ( ) = $ff ?(m) m ? ( ) = $ff ?(m) m ? ( ) = $ff ?(m) 1 dir inh inh ix1 ix 33 43 53 63 73 dd ff 5 3 3 6 5 cpx # opr cpx opr cpx opr cpx opr ,x cpx opr ,x cpx ,x compare index register with memory byte (x) ?(m) imm dir ext ix2 ix1 ix a3 b3 c3 d3 e3 f3 ii dd hh ll ee ff ff 2 3 4 5 4 3 dec opr deca decx dec opr ,x dec ,x decrement byte m ? (m) ?1 a ? (a) ?1 x ? (x) ?1 m ? (m) ?1 m ? (m) ?1 dir inh inh ix1 ix 3a 4a 5a 6a 7a dd ff 5 3 3 6 5 eor # opr eor opr eor opr eor opr ,x eor opr ,x eor ,x exclusive or accumulator with memory byte a ? (a) ? (m) imm dir ext ix2 ix1 ix a8 b8 c8 d8 e8 f8 ii dd hh ll ee ff ff 2 3 4 5 4 3 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc m a x m m f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 instruction set motorola rev 2 12-11 inc opr inca incx inc opr ,x inc ,x increment byte m ? (m) + 1 a ? (a) + 1 x ? (x) + 1 m ? (m) + 1 m ? (m) + 1 dir inh inh ix1 ix 3c 4c 5c 6c 7c dd ff 5 3 3 6 5 jmp opr jmp opr jmp opr ,x jmp opr ,x jmp ,x unconditional jump pc ? jump address dir ext ix2 ix1 ix bc cc dc ec fc dd hh ll ee ff ff 2 3 4 3 2 jsr opr jsr opr jsr opr ,x jsr opr ,x jsr ,x jump to subroutine pc ? (pc) + n (n = 1, 2, or 3) push (pcl); sp ? (sp) ?1 push (pch); sp ? (sp) ?1 pc ? conditional address dir ext ix2 ix1 ix bd cd dd ed fd dd hh ll ee ff ff 5 6 7 6 5 lda # opr lda opr lda opr lda opr ,x lda opr ,x lda ,x load accumulator with memory byte a ? (m) imm dir ext ix2 ix1 ix a6 b6 c6 d6 e6 f6 ii dd hh ll ee ff ff 2 3 4 5 4 3 ldx # opr ldx opr ldx opr ldx opr ,x ldx opr ,x ldx ,x load index register with memory byte x ? (m) imm dir ext ix2 ix1 ix ae be ce de ee fe ii dd hh ll ee ff ff 2 3 4 5 4 3 lsl opr lsla lslx lsl opr ,x lsl ,x logical shift left (same as asl) dir inh inh ix1 ix 38 48 58 68 78 dd ff 5 3 3 6 5 lsr opr lsra lsrx lsr opr ,x lsr ,x logical shift right 0 dir inh inh ix1 ix 34 44 54 64 74 dd ff 5 3 3 6 5 mul unsigned multiply x : a ? (x) (a) 0 0 inh 42 11 neg opr nega negx neg opr ,x neg ,x negate byte (two? complement) m ? ?m) = $00 ?(m) a ? ?a) = $00 ?(a) x ? ?x) = $00 ?(x) m ? ?m) = $00 ?(m) m ? ?m) = $00 ?(m) dir inh inh ix1 ix 30 40 50 60 70 ii ff 5 3 3 6 5 nop no operation inh 9d 2 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc c b0 b7 0 b0 b7 c 0 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola instruction set mc68HC05JB4 12-12 rev 2 ora # opr ora opr ora opr ora opr ,x ora opr ,x ora ,x logical or accumulator with memory a ? (a) (m) imm dir ext ix2 ix1 ix aa ba ca da ea fa ii dd hh ll ee ff ff 2 3 4 5 4 3 rol opr rola rolx rol opr ,x rol ,x rotate byte left through carry bit dir inh inh ix1 ix 39 49 59 69 79 dd ff 5 3 3 6 5 ror opr rora rorx ror opr ,x ror ,x rotate byte right through carry bit dir inh inh ix1 ix 36 46 56 66 76 dd ff 5 3 3 6 5 rsp reset stack pointer sp ? $00ff inh 9c 2 rti return from interrupt sp ? (sp) + 1; pull (ccr) sp ? (sp) + 1; pull (a) sp ? (sp) + 1; pull (x) sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 80 9 rts return from subroutine sp ? (sp) + 1; pull (pch) sp ? (sp) + 1; pull (pcl) inh 81 6 sbc # opr sbc opr sbc opr sbc opr ,x sbc opr ,x sbc ,x subtract memory byte and carry bit from accumulator a ? (a) ?(m) ?(c) imm dir ext ix2 ix1 ix a2 b2 c2 d2 e2 f2 ii dd hh ll ee ff ff 2 3 4 5 4 3 sec set carry bit c ? 1 1 inh 99 2 sei set interrupt mask i ? 1 1 inh 9b 2 sta opr sta opr sta opr ,x sta opr ,x sta ,x store accumulator in memory m ? (a) dir ext ix2 ix1 ix b7 c7 d7 e7 f7 dd hh ll ee ff ff 4 5 6 5 4 stop stop oscillator and enable irq pin 0 inh 8e 2 stx opr stx opr stx opr ,x stx opr ,x stx ,x store index register in memory m ? (x) dir ext ix2 ix1 ix bf cf df ef ff dd hh ll ee ff ff 4 5 6 5 4 table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc c b0 b7 b0 b7 c f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 instruction set motorola rev 2 12-13 sub # opr sub opr sub opr sub opr ,x sub opr ,x sub ,x subtract memory byte from accumulator a ? (a) ?(m) imm dir ext ix2 ix1 ix a0 b0 c0 d0 e0 f0 ii dd hh ll ee ff ff 2 3 4 5 4 3 swi software interrupt pc ? (pc) + 1; push (pcl) sp ? (sp) ?1; push (pch) sp ? (sp) ?1; push (x) sp ? (sp) ?1; push (a) sp ? (sp) ?1; push (ccr) sp ? (sp) ?1; i ? 1 pch ? interrupt vector high byte pcl ? interrupt vector low byte 1 inh 83 10 tax transfer accumulator to index register x ? (a) inh 97 2 tst opr tsta tstx tst opr ,x tst ,x test memory byte for negative or zero (m) ?$00 dir inh inh ix1 ix 3d 4d 5d 6d 7d dd ff 4 3 3 5 4 txa transfer index register to accumulator a ? (x) inh 9f 2 wait stop cpu clock and enable interrupts 0 inh 8f 2 a accumulator opr operand (one or two bytes) c carry/borrow flag pc program counter ccr condition code register pch program counter high byte dd direct address of operand pcl program counter low byte dd rr direct address of operand and relative offset of branch instruction rel relative addressing mode dir direct addressing mode rel relative program counter offset byte ee ff high and low bytes of offset in indexed, 16-bit offset addressing rr relative program counter offset byte ext extended addressing mode sp stack pointer ff offset byte in indexed, 8-bit offset addressing x index register h half-carry flag z zero flag hh ll high and low bytes of operand address in extended addressing # immediate value i interrupt mask logical and ii immediate operand byte logical or imm immediate addressing mode ? logical exclusive or inh inherent addressing mode ( ) contents of ix indexed, no offset addressing mode ? ) negation (two? complement) ix1 indexed, 8-bit offset addressing mode ? loaded with ix2 indexed, 16-bit offset addressing mode ? if m memory location : concatenated with n negative flag set or cleared n any bit not affected table 12-6. instruction set summary (continued) source form operation description effect on ccr address mode opcode operand cycles h i nzc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola instruction set mc68HC05JB4 12-14 rev 2 table 12-7. opcode map bit manipulation branch read-modify-write control register/memory dir dir rel dir inh inh ix1 ix inh inh imm dir ext ix2 ix1 ix 0123456789abcdef 0 5 brset0 3 dir 5 bset0 2 dir 3 bra 2 rel 5 neg 2 dir 3 nega 1 inh 3 negx 1 inh 6 neg 2 ix1 5 neg 1ix 9 rti 1 inh 2 sub 2 imm 3 sub 2 dir 4 sub 3 ext 5 sub 3 ix2 4 sub 2 ix1 3 sub 1ix 0 1 5 brclr0 3 dir 5 bclr0 2 dir 3 brn 2 rel 6 rts 1 inh 2 cmp 2 imm 3 cmp 2 dir 4 cmp 3 ext 5 cmp 3 ix2 4 cmp 2 ix1 3 cmp 1ix 1 2 5 brset1 3 dir 5 bset1 2 dir 3 bhi 2 rel 11 mul 1 inh 2 sbc 2 imm 3 sbc 2 dir 4 sbc 3 ext 5 sbc 3 ix2 4 sbc 2 ix1 3 sbc 1ix 2 3 5 brclr1 3 dir 5 bclr1 2 dir 3 bls 2 rel 5 com 2 dir 3 coma 1 inh 3 comx 1 inh 6 com 2 ix1 5 com 1ix 10 swi 1 inh 2 cpx 2 imm 3 cpx 2 dir 4 cpx 3 ext 5 cpx 3 ix2 4 cpx 2 ix1 3 cpx 1ix 3 4 5 brset2 3 dir 5 bset2 2 dir 3 bcc 2 rel 5 lsr 2 dir 3 lsra 1 inh 3 lsrx 1 inh 6 lsr 2 ix1 5 lsr 1ix 2 and 2 imm 3 and 2 dir 4 and 3 ext 5 and 3 ix2 4 and 2 ix1 3 and 1ix 4 5 5 brclr2 3 dir 5 bclr2 2 dir 3 bcs/blo 2 rel 2 bit 2 imm 3 bit 2 dir 4 bit 3 ext 5 bit 3 ix2 4 bit 2 ix1 3 bit 1ix 5 6 5 brset3 3 dir 5 bset3 2 dir 3 bne 2 rel 5 ror 2 dir 3 rora 1 inh 3 rorx 1 inh 6 ror 2 ix1 5 ror 1ix 2 lda 2 imm 3 lda 2 dir 4 lda 3 ext 5 lda 3 ix2 4 lda 2 ix1 3 lda 1ix 6 7 5 brclr3 3 dir 5 bclr3 2 dir 3 beq 2 rel 5 asr 2 dir 3 asra 1 inh 3 asrx 1 inh 6 asr 2 ix1 5 asr 1ix 2 tax 1 inh 4 sta 2 dir 5 sta 3 ext 6 sta 3 ix2 5 sta 2 ix1 4 sta 1ix 7 8 5 brset4 3 dir 5 bset4 2 dir 3 bhcc 2 rel 5 asl/lsl 2 dir 3 asla/lsla 1 inh 3 aslx/lslx 1 inh 6 asl/lsl 2 ix1 5 asl/lsl 1ix 2 clc 1 inh 2 eor 2 imm 3 eor 2 dir 4 eor 3 ext 5 eor 3 ix2 4 eor 2 ix1 3 eor 1ix 8 9 5 brclr4 3 dir 5 bclr4 2 dir 3 bhcs 2 rel 5 rol 2 dir 3 rola 1 inh 3 rolx 1 inh 6 rol 2 ix1 5 rol 1ix 2 sec 1 inh 2 adc 2 imm 3 adc 2 dir 4 adc 3 ext 5 adc 3 ix2 4 adc 2 ix1 3 adc 1ix 9 a 5 brset5 3 dir 5 bset5 2 dir 3 bpl 2 rel 5 dec 2 dir 3 deca 1 inh 3 decx 1 inh 6 dec 2 ix1 5 dec 1ix 2 cli 1 inh 2 ora 2 imm 3 ora 2 dir 4 ora 3 ext 5 ora 3 ix2 4 ora 2 ix1 3 ora 1ix a b 5 brclr5 3 dir 5 bclr5 2 dir 3 bmi 2 rel 2 sei 1 inh 2 add 2 imm 3 add 2 dir 4 add 3 ext 5 add 3 ix2 4 add 2 ix1 3 add 1ix b c 5 brset6 3 dir 5 bset6 2 dir 3 bmc 2 rel 5 inc 2 dir 3 inca 1 inh 3 incx 1 inh 6 inc 2 ix1 5 inc 1ix 2 rsp 1 inh 2 jmp 2 dir 3 jmp 3 ext 4 jmp 3 ix2 3 jmp 2 ix1 2 jmp 1ix c d 5 brclr6 3 dir 5 bclr6 2 dir 3 bms 2 rel 4 tst 2 dir 3 tsta 1 inh 3 tstx 1 inh 5 tst 2 ix1 4 tst 1ix 2 nop 1 inh 6 bsr 2 rel 5 jsr 2 dir 6 jsr 3 ext 7 jsr 3 ix2 6 jsr 2 ix1 5 jsr 1ix d e 5 brset7 3 dir 5 bset7 2 dir 3 bil 2 rel 2 stop 1 inh 2 ldx 2 imm 3 ldx 2 dir 4 ldx 3 ext 5 ldx 3 ix2 4 ldx 2 ix1 3 ldx 1ix e f 5 brclr7 3 dir 5 bclr7 2 dir 3 bih 2 rel 5 clr 2 dir 3 clra 1 inh 3 clrx 1 inh 6 clr 2 ix1 5 clr 1ix 2 wait 1 inh 2 txa 1 inh 4 stx 2 dir 5 stx 3 ext 6 stx 3 ix2 5 stx 2 ix1 4 stx 1ix f inh = inherent rel = relative imm = immediate ix = indexed, no offset dir = direct ix1 = indexed, 8-bit offset ext = extended ix2 = indexed, 16-bit offset 0 msb of opcode in hexadecimal lsb of opcode in hexadecimal 0 5 brset0 3 dir number of cycles opcode mnemonic number of bytes/addressing mode lsb msb lsb m s b lsb msb f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 electrical specifications motorola rev 2 13-1 section 13 electrical specifications this section describes the electrical and timing speci?ations of the mc68HC05JB4. 13.1 maximum ratings note maximum ratings are the extreme limits the device can be exposed to without causing permanent damage to the chip. the device is not intended to operate at these conditions. the mcu contains circuitry that protect the inputs against damage from high static voltages; however, do not apply voltages higher than those shown in the table below. keep v in and v out within the range from v ss (v in or v out ) v dd . connect unused inputs to the appropriate voltage level, either v ss or v dd . 13.2 thermal characteristics (voltages referenced to v ss ) rating symbol value unit supply voltage v dd 0.3 to +7.0 v current drain per pin excluding v dd and v ss i25ma input voltage v in v ss ?0.3 to v ss + 0.3 v i rq /v pp pin v pp v ss ?.3 to 17 v storage temperature range t stg 65 to +150 c characteristic symbol value unit thermal resistance 28-pin pdip 28-pin soic q ja q ja 60 60 c/w c/w f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola electrical specifications mc68HC05JB4 13-2 rev 2 13.3 dc electrical characteristics table 13-1. dc electrical characteristics (v dd = 4.2v to 5.5v, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min typ max unit output voltage i load = 10.0 m a v ol v oh v dd ?.1 0.1 v output high voltage (i load =?.8 ma) pa0-7, pb0-4, pc0-5 v oh v dd ?.8 v output low voltage (i load = 1.6 ma) pa0-4, pb0-4, pc0-5 (i load = 10.0 ma) pa5-7 (i load = 25.0 ma) pa6, pa7 (mask option) v ol 0.4 0.4 0.5 v input high voltage pa0-7, pb0-4, pc0-5, i rq , reset , osc1 v ih 0.7 v dd ? dd v input low voltage pa0-7, pb0-4, pc0-5, i rq , reset , osc1 v il v ss 0.2 v dd v supply current (see notes) run (usb active) run (usb suspended) wait (usb active) wait (usb suspended) stop lvr off at 25 c (not inlcude 15k to gnd) i dd 4.0 3.5 1.5 1.0 130 4.5 4.0 2.0 1.5 180 ma ma ma ma m a i/o ports hi-z leakage current pa0-7, pb0-4, pc0-5 (without individual pulldown/up activated) i z 10 m a input current reset , irq , osc1 i in 5m a capacitance ports (as input or output) rese t , irq , osc1, osc2 c out c in 12 8 pf pf crystal/ceramic resonator oscillator mode internal resistor osc1 to osc2 r osc 1.0 2.0 3.0 m w pullup resistor pa0-7, pb0-4 r pullup 30 50 75 k w lvr inhibit v lvri 3.3 v lvr recover v lvrr 3.5 v f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 electrical specifications motorola rev 2 13-3 notes: 1. all values shown re?ct average measurements. 2. typical values at midpoint of voltage range, 25 c only. 3. wait i dd : only mft and timer1 active. 4. run (operating) i dd , wait i dd : measured using external square wave clock source to osc1 (f osc = 6.0 mhz), all inputs 0.2 vdc from rail; no dc loads, less than 50pf on all outputs, c l = 20 pf on osc2. 5. wait, stop i dd : all ports con?ured as inputs, v il = 0.2 vdc, v ih = v dd ?.2 vdc. 6. stop i dd measured with osc1 = v ss . 7. wait i dd is affected linearly by the osc2 capacitance. 13.4 usb dc electrical characteristics table 13-2. usb dc electrical characteristics (v dd = 4.2v to 5.5v, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol conditions min typ max unit hi-z state data line leakage i lo 0v general release specification february 24, 1999 motorola electrical specifications mc68HC05JB4 13-4 rev 2 13.5 usb low speed source electrical characteristics notes: 1. all voltages measured from local ground, unless otherwise speci?d. 2. all timings use a capacitive load of 50pf, unless otherwise speci?d. 3. low speed timings have a 1.5k pull-up to 2.8v on the d?data line. 4. measured from 10% to 90% of the data signal. 5. the rising and falling edges should be smooth transitions (monotonic). 6. timing differences between the differential data signals. 7. measured at crossover point of differential data signals. 8. capacitive loading includes 50pf of tester capacitance. table 13-3. usb low speed source electrical characteristics parameter symbol conditions (notes 1,2,3) min typ max unit transition time: rise time fall time t r t f notes 4, 5, 8 c l =50pf c l =350pf c l =50pf c l =350pf 75 75 300 300 ns ns ns ns rise/fall time matching t rfm t r /t f 80 120 % output signal crossover voltage v crs 1.3 2.0 v low speed data rate t drate 1.5mbs 1.5% 1.4775 676.8 1.500 666.0 1.5225 656.8 mbs ns source differential driver jitter to next transition for paired transitions t udj1 t udj2 c l =350pf notes 6 and 7 ?5 ?0 25 10 ns ns receiver data jitter tolerance to next transition for paired transitions t djr1 t djr2 c l =350pf notes 7 ?5 ?5 75 45 ns ns source eop width teopt note 7 1.25 1.50 m s differential to eop transition skew tdeop note 7 ?0 100 ns receiver eop width must reject as eop must accept t eopr1 t eopr2 note 7 330 675 ns ns f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 electrical specifications motorola rev 2 13-5 13.6 control timing notes: 1. the minimum period t ilil or t ihih should not be less than the number of cycles it takes to execute the interrupt service routine plus 19 t cyc . table 13-4. control timing (v dd = 4.2v to 5.5v, v ss = 0 vdc, t a = 0 c to +70 c, unless otherwise noted) characteristic symbol min max units frequency of operation crystal oscillator option external clock source f osc f osc dc 6 6 mhz mhz internal operating frequency crystal oscillator (f osc ? 2) external clock (f osc ? 2) f op f op dc 3 3 mhz mhz cycle time (1/f op )t cyc 330 ns reset pulse width low t rl 1.5 t cyc irq interrupt pulse width low (edge-triggered) t ilih 0.5 t cyc irq interrupt pulse period t ilil note 1 t cyc pa0 to pa3 interrupt pulse width high (edge-triggered) t ihil 0.5 t cyc pa0 to pa3 interrupt pulse period t ihih note 1 t cyc osc1 pulse width t oh , t ol ns output high to low transition period on pa6, pa7, pb0-4 t slow 0.5 (typical) t cyc f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola electrical specifications mc68HC05JB4 13-6 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 mechanical specifications motorola rev 2 14-1 section 14 mechanical specifications this section provides the mechanical dimensions for the 28-pin pdip and 28-pin soic packages. 14.1 28-pin pdip (case 710) 14.2 28-pin soic (case 751f) notes: 1. positional tolerance of leads (d), shall be within 0.25 (0.010) at maximum material condition, in relation to seating plane and each other. 2. dimension l to center of leads when formed parallel. 3. dimension b does not include mold flash. 1 seating plane 15 14 28 m a b k c n f g d h j l dim min max min max inches millimeters a 36.45 37.21 1.435 1.465 b 13.72 14.22 0.540 0.560 c 3.94 5.08 0.155 0.200 d 0.36 0.56 0.014 0.022 f 1.02 1.52 0.040 0.060 g 2.54 bsc 0.100 bsc h 1.65 2.16 0.065 0.085 j 0.20 0.38 0.008 0.015 k 2.92 3.43 0.115 0.135 l 15.24 bsc 0.600 bsc m 0 15 0 15 n 0.51 1.02 0.020 0.040 notes: 1. dimensioning and tolerancing per ansi y14.5m, 1982. 2. controlling dimension: millimeter. 3. dimension a and b do not include mold protrusion. 4. maximum mold protrusion 0.15 (0.006) per side. 5. dimension d does not include dambar protrusion. allowable dambar protrusion shall be 0.13 (0.005) total in excess of d dimension at maximum material condition. j k f 1 15 14 28 -a- -b- 28x 14x d p s a m 0.010 (0.25) b s t m 0.010 (0.25) b m 26x g -t- seating plane c x 45 r m dim min max min max inches millimeters a 17.80 18.05 0.701 0.711 b 7.40 7.60 0.292 0.299 c 2.35 2.65 0.093 0.104 d 0.35 0.49 0.014 0.019 f 0.41 0.90 0.016 0.035 g 1.27 bsc 0.050 bsc j 0.23 0.32 0.009 0.013 k 0.13 0.29 0.005 0.011 m p 10.01 10.55 0.395 0.415 r 0.25 0.75 0.010 0.029 0 0 8 8 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mechanical specifications mc68HC05JB4 14-2 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 a-1 appendix a mc68hc705jb4 this appendix describes the mc68hc705jb4, the emulation part for mc68HC05JB4. the entire mc68HC05JB4 data sheet applies to the mc68hc705jb4, with exceptions outlined in this appendix. a.1 introduction the mc68hc705jb4 is an eprom version of the mc68HC05JB4, and is avail- able for user system evaluation and debugging. the mc68hc705jb4 is function- ally identical to the mc68HC05JB4 with the exception of the 3584 bytes user rom is replaced by 3584 bytes user eprom. also, the mask options available on the mc68HC05JB4 are implemented using the mask option register (mor) in the mc68hc705jb4. a.2 memory the mc68hc705jb4 memory map is shown in figure a-1 . a.3 mask option register (mor) the mask option register (mor) is a byte of eprom used to select the features controlled by mask options on the mc68HC05JB4. in order to program this regis- ter the moron bit in pcr need to be set to ? before doing the eprom pro- gramming process. copen ?cop enable 1 = cop watchdog function disabled. 0 = cop watchdog function enabled. irqtrig ?irq, pa0-pa3 interrupt options 1 = edge-trigger only. 0 = edge-and-level-triggered. highcurra ?pa6 and pa7 high current enable 1 = high current capability disabled on pa6 and pa7. 0 = high current capability enabled on pa6 and pa7. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 mor r copen irqtrig highcurra painten oscdly lvren $007f w reset: 00111111 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 a-2 rev 2 painten ?pa0-pa3 external interrupt options 1 = external interrupt capability on pa0-pa3 disabled. 0 = external interrupt capability on pa0-pa3 enabled. oscdly ?oscillator delay option 1 = 128 internal clock cycles. 0 = 4064 internal clock cycles. lvren ?lvr option 1 = low voltage reset circuit enabled. 0 = low voltage reset circuit disabled. figure a-1. mc68hc705jb4 memory map a.4 bootstrap mode bootloader mode is entered upon the rising edge of reset if the irq /v pp pin is at v tst and the pb0 pin is at logic zero. the bootloader program is masked in the rom area from $1e00 to $1fef. this program handles copying of user code from an external eprom into the on-chip eprom. the bootload function has to be done from an external eprom. the bootloader performs one programming pass at 1ms per byte then does a verify pass. $1ff7 $1ff8 $1ff9 $1ffa $1ffb $1ffc $1ffd $1ffe $1fff $003f $0000 $1ff6 $1ff3 $1ff4 $1ff5 $1ff2 $1ff1 reserved usb vector (low byte) timer1 vector (low byte) usb vector (high byte) timer1 vector (high byte) mft vector (low byte) mft vector (high byte) reserved $1ff0 reserved reserved irq/irq2 vector (high byte) irq/irq2 vector (low byte) swi vector (high byte) swi vector (low byte) reset vector (high byte) reset vector (low byte) i/o registers 64 bytes i/o registers 64 bytes $0000 $003f $0040 $007f unused 63 bytes user ram 176 bytes 64 byte stack $0080 $00c0 $00ff $012f $0130 $0fff unused 3792 bytes $1000 $1dff $1e00 $1fef user eprom 3584 bytes bootstrap rom 496 bytes user vectors 16 bytes $1ff0 $1fff mask option register $007e eprom program control register $003e f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 a-3 the user code must be a one-to-one correspondence with the internal eprom addresses. a.5 eprom programming programming the on-chip eprom is achieved by using the program control reg- ister located at address $3e. please contact motorola for programming board availability. a.5.1 eprom program control register (pcr) this register is provided for programming the on-chip eprom in the mc68hc705jb4. moron ?mask option register on 0 = disable programming to mask option register ($007f) 1 = enable programming to mask option register ($007f) elat ?eprom latch control 0 = eprom address and data bus con?ured for normal reads 1 = eprom address and data bus con?ured for programming (writes to eprom cause address and data to be latched). eprom is in programming mode and cannot be read if elat is 1. this bit should not be set when no programming voltage is applied to the v pp pin. pgm ?eprom program command 0 = programming power is switched off from eprom array. 1 = programming power is switched on to eprom array. if elat 1 1, then pgm = 0. a.5.2 programming sequence the eprom programming sequence is: 1. set the elat bit 2. write the data to the address to be programmed 3. set the pgm bit 4. delay for a time t pgmr 5. clear the pgm bit 6. clear the elat bit the last two steps must be performed with separate cpu writes. bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 pcr r reserved moron elat pgm $003e w reset: 00000000 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 a-4 rev 2 caution it is important to remember that an external programming voltage must be applied to the v pp pin while programming, but it should be equal to v dd during normal operations. figure a-2 shows the ?w required to successfully program the eprom. figure a-2. eprom programming sequence start elat=1 write eprom byte epgm=1 wait 1ms epgm=0 elat=0 write additional byte? n y end f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
february 24, 1999 general release specification mc68HC05JB4 motorola rev 2 a-5 a.6 eprom programming specifications a.7 dc electrical characteristics table a-1. eprom programming electrical characteristics (v dd = 4.2v to 5.5v , v ss = 0 vdc, t a = 0 c to +40 c, unless otherwise noted) characteristic symbol min typ max unit programming voltage irq /v pp v pp 13.5 v programming current irq /v pp i pp 5 10 ma programming time per byte t epgm 1 ?s table a-2. dc electrical characteristics (705jb4) (v dd = 4.2v to 5.5v, v ss = 0 vdc, t a = 0 c to +40 c, unless otherwise noted) characteristic symbol min typ max unit supply current (see notes) run (usb active) run (usb suspended) wait (usb active) wait (usb suspended) stop lvr off at 25 c (not include 15k to gnd) i dd 130 7.5 6.5 4.0 3.0 180 ma ma ma ma m a f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
general release specification february 24, 1999 motorola mc68HC05JB4 a-6 rev 2 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, represe ntation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application o r use of any product or circuit, and speci?ally disclaims any and all liability, including without limitation consequential or incidental damages. "typical" parameters which may be provided in motorola data sheets and/or speci?ations can and do vary in different applications and actual performance may vary over time. all operating parameters, i ncluding "typicals" must be validated for each customer application by customer's technical experts. motorola does not convey any license under its patent rights nor th e rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applic ations intended to support or sustain life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its of?ers, employees, subsidiaries, af?iates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly o r indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and are registered trademarks of motorola, inc. motorola, inc. is an equal opportunity/af?mative action employer. how to reach us: usa/europe/locations not listed: motorola literature distribution; p.o. box 5405, denver, colorado 80217. 1-800-441-2447 or 1-303-675-2140 japan: nippon motorola ltd. spd, strategic planning of?e 4-32-1, nishi-gotanda, shinagawa-ku, tokyo 141, japan. 03-5487-8488 mfax tm , motorola fax back system: rmfax0@email.sps.mot.com; http://sps.motorola.com/mfax/; touchtone 1-602-244-6609; us and canada only 1-800-774-1848 home page: http://motorola.com/sps/ mfax is a trademark of motorola, inc. ?motorola, inc., 1999 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of 68HC05JB4

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X